Skip to content
Myr

Merge pull request #502 from bkendall/fix-sub-sub-commands

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fix Sub-Subcommands

authored by Randall Koutnik · committed by Randall Koutnik · parents 920dc87, 33751b4 · Browse files · 6 files+43 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

6 files+43 added−2 removed

  • tests:+41 added−0 removed
  • other:+2 added−2 removed

6 files+43 added−2 removed

modified:test/fixtures/pm+1 added
4 unmodified lines
5program6 .version('0.0.1')7 .command('install [name]', 'install one or more packages')8 .command('search [query]', 'search with optional query')9 .command('cache', 'actions dealing with the cache')10 .command('list', 'list packages installed')11 .command('publish', 'publish or update package')12 .command('default', 'default command', {noHelp: true, isDefault: true})13 .parse(process.argv);
added:test/fixtures/pm-cache-clear.js+1 added
added:test/fixtures/pm-cache-validate.js+1 added
added:test/fixtures/pm-cache.js+6 added
added:test/test.command.executableSubcommandSubCommand.js+32 added
modified:index.js+2 added-2 removed
523 unmodified lines
524525 var proc;526 if (process.platform !== 'win32') {527 if (isExplicitJS) {528 args.unshift(localBin);528 args.unshift(bin);529 // add executable arguments to spawn530 args = (process.execArgv || []).concat(args);531532 proc = spawn('node', args, { stdio: 'inherit', customFds: [0, 1, 2] });533 } else {534 proc = spawn(bin, args, { stdio: 'inherit', customFds: [0, 1, 2] });535 }536 } else {537 args.unshift(localBin);537 args.unshift(bin);538 proc = spawn(process.execPath, args, { stdio: 'inherit'});539 }540541 proc.on('close', process.exit.bind(process));
569 unmodified lines