Skip to content
Myr

support subcommands on windows. Fixes #142

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

authored by yiminghe · committed by yiminghe · parent 38b7adb · Browse files · 1 file+4 added−3 removed
This commit

State

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

Diff stats

1 file+4 added−3 removed

  • other:+4 added−3 removed

1 file+4 added−3 removed

modified:index.js+4 added-3 removed
359 unmodified lines
360 // store raw args361 this.rawArgs = argv;362363 // guess name364 this._name = this._name || basename(argv[1]);364 this._name = this._name || basename(argv[1], '.js');365366 // process argv367 var parsed = this.parseOptions(this.normalize(argv.slice(2)));368 var args = this.args = parsed.args;
29 unmodified lines
398 }399400 // executable401 var dir = dirname(argv[1]);402 var bin = basename(argv[1]) + '-' + args[0];402 var bin = basename(argv[1], '.js') + '-' + args[0];403404 // check for ./<bin> first405 var local = path.join(dir, bin);406407 // run it408 args = args.slice(1);409 args.unshift(local);409 var proc = spawn(local, args, { stdio: 'inherit', customFds: [0, 1, 2] });410 var proc = spawn('node', args, { stdio: 'inherit', customFds: [0, 1, 2] });411 proc.on('error', function(err){412 if (err.code == "ENOENT") {413 console.error('\n %s(1) does not exist, try --help\n', bin);414 } else if (err.code == "EACCES") {
434 unmodified lines