Permalink
Browse files

Use process.execPath, re #9

  • Loading branch information...
chriso committed Apr 10, 2012
1 parent cc3e059 commit 919ee058947571b2b1a88d88e400b3b5875dc665
Showing with 3 additions and 2 deletions.
  1. +3 −2 cli.js
View
5 cli.js
@@ -142,8 +142,9 @@ cli.setArgv = function (arr, keep_arg0) {
arr = arr.slice();
}
cli.app = arr.shift();
- //Strip off argv[0] if it's 'node'
- if (!keep_arg0 && 'node' === cli.native.path.basename(cli.app)) {
+ //Strip off argv[0] if it's a node binary
+ if (!keep_arg0 && ('node' === cli.native.path.basename(cli.app)
+ || process.execPath === cli.app)) {
cli.app = arr.shift();
}
cli.app = cli.native.path.basename(cli.app);

0 comments on commit 919ee05

Please sign in to comment.