Skip to content

Commit

Permalink
Fix multi option parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
lettertwo committed Nov 17, 2022
1 parent a93ad5b commit 82136fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions packages/dev/parcel-link/bin/link.js
Expand Up @@ -32,7 +32,6 @@ program
.option(
'-g, --node-modules-globs <globs...>',
'Locations where node_modules should be linked in the app',
value => (Array.isArray(value) ? value : [value]),
'node_modules',
)
.action((packageRoot, options) => {
Expand All @@ -41,7 +40,9 @@ program
appRoot: process.cwd(),
packageRoot: packageRoot ?? path.join(__dirname, '../../../'),
namespace: options.namespace,
nodeModulesGlobs: options.nodeModulesGlobs,
nodeModulesGlobs: Array.isArray(options.nodeModulesGlobs)
? options.nodeModulesGlobs
: [options.nodeModulesGlobs],
dryRun: options.dryRun,
log: console.log,
});
Expand Down
5 changes: 3 additions & 2 deletions packages/dev/parcel-link/bin/unlink.js
Expand Up @@ -31,15 +31,16 @@ program
.option(
'-g, --node-modules-globs <globs...>',
'Locations where node_modules should be unlinked in the app',
value => (Array.isArray(value) ? value : [value]),
'node_modules',
)
.action((packageRoot, options) => {
if (options.dryRun) console.log('Dry run...');
unlink({
appRoot: process.cwd(),
namespace: options.namespace,
nodeModulesGlobs: options.nodeModulesGlobs,
nodeModulesGlobs: Array.isArray(options.nodeModulesGlobs)
? options.nodeModulesGlobs
: [options.nodeModulesGlobs],
dryRun: options.dryRun,
forceInstall: options.forceInstall,
log: console.log,
Expand Down

0 comments on commit 82136fb

Please sign in to comment.