Skip to content

Commit

Permalink
Add guard to return early if shouldn't zip
Browse files Browse the repository at this point in the history
  • Loading branch information
ewc340 committed Mar 5, 2022
1 parent 985f342 commit d308f6e
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,23 @@ async function pack(args: Args) {
// Should zip the packages for each platform by default
const shouldZip = args.shouldZip ?? true;

if (shouldZip) {
map(
appPaths,
async (appPath: string | boolean) => {
if (appPath == true) {
// Package for platform already exists, so no need to do anything
return;
}
console.log(`Zipping ${appPath}`);

await zip(appPath as string);
},
{ concurrency: appPaths.length }
);
if (!shouldZip) {
return;
}

map(
appPaths,
async (appPath: string | boolean) => {
if (appPath == true) {
// Package for platform already exists, so no need to do anything
return;
}
console.log(`Zipping ${appPath}`);

await zip(appPath as string);
},
{ concurrency: appPaths.length }
);
}

pack(minimist(process.argv.slice(2))).then(() => console.log('Packaging Done'));

0 comments on commit d308f6e

Please sign in to comment.