Skip to content

Commit

Permalink
docs: use latest theme
Browse files Browse the repository at this point in the history
  • Loading branch information
danielleroux committed Apr 23, 2024
1 parent 830a65b commit 96ba03b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
1 change: 0 additions & 1 deletion .github/workflows/deploy-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@ jobs:
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: ./packages/documentation/build
clean-exclude: version-*

31 changes: 19 additions & 12 deletions packages/documentation/scripts/download-theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import zlib from 'zlib';

const pkgRoot = path.join(__dirname, '..');

const version = "2.0.0";
const version = '2.1.0';
const token = process.env.CSC;
const ci = process.env.CI;

Expand All @@ -37,20 +37,27 @@ const ci = process.env.CI;
const response = await axios.get(
`https://code.siemens.com/api/v4/projects/249177/packages/npm/@siemens/ix-brand-theme/-/@siemens/ix-brand-theme-${version}.tgz`,
{
responseType: "arraybuffer", headers: {
"Authorization": `Bearer ${token}`
} }
responseType: 'arraybuffer',
headers: {
Authorization: `Bearer ${token}`,
},
}
);
const fileData = Buffer.from(response.data, "binary");
const fileData = Buffer.from(response.data, 'binary');
await fs.writeFile(file, fileData);
await unpack(file);
})()
})();

async function unpack(file: string) {
return new Promise(resolve => fs.createReadStream(file)
.pipe(zlib.createGunzip())
.pipe(tar.extract({
cwd: path.join(file, '..')
}))
.on('finish', resolve))
return new Promise((resolve) =>
fs
.createReadStream(file)
.pipe(zlib.createGunzip())
.pipe(
tar.extract({
cwd: path.join(file, '..'),
})
)
.on('finish', resolve)
);
}

0 comments on commit 96ba03b

Please sign in to comment.