Skip to content

Commit

Permalink
Fix existing usage of names/type in build command
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Pope committed Jul 24, 2024
1 parent a6b7e43 commit ab3a0f3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
14 changes: 5 additions & 9 deletions scripts/rollup/build-all-release-channels.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,12 @@ const argv = yargs.wrap(yargs.terminalWidth()).options({
type: 'choices',
choices: ['circleci', 'github'],
},
bundle: {
describe: 'Build the given bundle type.',
type: {
describe: `Build the given bundle type. (${Object.values(
Bundles.bundleTypes
)})`,
requiresArg: false,
type: 'choices',
choices: [...Object.values(Bundles.bundleTypes)],
},
names: {
describe: 'Build for matched bundle names. Example: "react-test,index.js".',
requiresArg: false,
type: 'array',
type: 'string',
},
pretty: {
describe: 'Force pretty output.',
Expand Down
10 changes: 7 additions & 3 deletions scripts/rollup/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,15 @@ function parseRequestedNames(names, toCase) {
}
return result;
}
const argvType = Array.isArray(argv.bundle) ? argv.bundle : [argv.bundle];
const requestedBundleTypes = argv.bundle ? argvType : [];
const argvType = Array.isArray(argv.type) ? argv.type : [argv.type];
const requestedBundleTypes = parseRequestedNames(
argv.type ? argvType : [],
'uppercase'
);

const names = argv._;
const requestedBundleNames = parseRequestedNames(
argv.names ? argv.names : [],
names ? names : [],
'lowercase'
);
const forcePrettyOutput = argv.pretty;
Expand Down

0 comments on commit ab3a0f3

Please sign in to comment.