Skip to content
Myr

Merge pull request #157 from noway421/patch-2

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

More nicer error handling

authored by TJ Holowaychuk · committed by TJ Holowaychuk · parents 9766406, 82c3cbe · Browse files · 1 file+6 added−5 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+6 added−5 removed

  • other:+6 added−5 removed

1 file+6 added−5 removed

modified:index.js+6 added-5 removed
405 unmodified lines
406 var bin = basename(argv[1]) + '-' + args[0];407408 // check for ./<bin> first409 var local = path.join(dir, bin);410 if (exists(local)) bin = local;410411 // run it412 args = args.slice(1);414 var proc = spawn(bin, args, { stdio: 'inherit', customFds: [0, 1, 2] });415 proc.on('exit', function(code){416 if (code == 127) {417 console.error('\n %s(1) does not exist\n', bin);413 var proc = spawn(local, args, { stdio: 'inherit', customFds: [0, 1, 2] });414 proc.on('error', function(err){415 if (err.code == "ENOENT") {416 console.error('\n %s(1) does not exist, try --help\n', bin);417 } else if (err.code == "EACCES") {418 console.error('\n %s(1) not executable. try chmod or run with root\n', bin);419 }420 });421};422
733 unmodified lines