Skip to content

Commit

Permalink
build(zip): include web assets in the release zip (#603)
Browse files Browse the repository at this point in the history
feat: include web assets in the release zip
  • Loading branch information
Palke authored Nov 22, 2024
1 parent b7e277d commit 4b8acbe
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions scripts/prepare-zip.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const globDirectory = type => {
return folders;
}

const writeZip = (typeName, folders) => {
/*const writeZip = (typeName, folders) => {
fs.ensureDirSync(OUTPUT_DIRECTORY);
fs.removeSync(`${OUTPUT_DIRECTORY}/${typeName}`);
Expand All @@ -61,30 +61,33 @@ const writeZip = (typeName, folders) => {
fs.copySync(source, dest);
});
});
};

const writeWebFiles = () => {
};*/

fs.ensureDirSync(`${OUTPUT_DIRECTORY}/Web`);
const writeFiles = () => {

const files = getFontDirectories();

files.forEach(name => {
fs.ensureDirSync(`${OUTPUT_DIRECTORY}/Web/${name}`);
fs.copySync(`packages/${name}/fonts`, `${OUTPUT_DIRECTORY}/Web/${name}/fonts`);
fs.copySync(`packages/${name}/css`, `${OUTPUT_DIRECTORY}/Web/${name}/css`);
fs.copySync(`packages/${name}/scss`, `${OUTPUT_DIRECTORY}/Web/${name}/scss`);
fs.copySync('LICENSE.txt', `${OUTPUT_DIRECTORY}/Web/${name}/LICENSE.txt`);
fs.copySync('CHANGELOG.md', `${OUTPUT_DIRECTORY}/Web/${name}/CHANGELOG.md`);

//fs.ensureDirSync(`${OUTPUT_DIRECTORY}/Web`);
//fs.ensureDirSync(`${OUTPUT_DIRECTORY}/Web/${name}`);

//fs.copySync(`packages/${name}/fonts`, `${OUTPUT_DIRECTORY}/Web/${name}/fonts`);

fs.ensureDirSync(`${OUTPUT_DIRECTORY}/ibm-${name}`);

fs.copySync(`packages/${name}/fonts`, `${OUTPUT_DIRECTORY}/ibm-${name}/fonts`);

fs.copySync(`packages/${name}/css`, `${OUTPUT_DIRECTORY}/ibm-${name}/css`);
fs.copySync(`packages/${name}/scss`, `${OUTPUT_DIRECTORY}/ibm-${name}/scss`);
fs.copySync('LICENSE.txt', `${OUTPUT_DIRECTORY}/ibm-${name}/LICENSE.txt`);
//fs.copySync('CHANGELOG.md', `${OUTPUT_DIRECTORY}/${name}/CHANGELOG.md`);

});
}

writeZip('OpenType', globDirectory('otf'));
//writeZip('OpenType', globDirectory('otf'));

writeZip('TrueType', globDirectory('ttf'));
//writeZip('TrueType', globDirectory('ttf'));

writeWebFiles();
writeFiles();

0 comments on commit 4b8acbe

Please # to comment.