-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixes shebang execution on Node 5.8.x #14
Conversation
disable a couple tests that never worked on 0.10 on Windows
@@ -141,6 +145,39 @@ function wrap (argv, env, workingDir) { | |||
return unwrap | |||
} | |||
|
|||
// handle special cases of shebang, e.g., the | |||
// 2>/dev/null; exec "`dirname "$0"`/node" "$0" "$@" | |||
// approach used in Node 5.8.0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentiond in the nyc issue, this shebang replacement only applies to the npm
executable – I think it would be a good idea to mention that here, otherwise the comment might be a little confusing?
Also, this “special” shebang approach itself is quite old, it’s the combination of it with the npm version shipped with v5.8.0 that creates the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updating.
I think some parts of this are orthogonal to #13: You only check for the “strange” shebang installed by Node.js executables (which #13 doesn’t), but there’s no reason not to catch something like Anyway, both skipping any tests on Windows and using |
@isaacs @addaleax having slept on this, I think @addaleax's original approach of only applying this logic to the tldr; I think this is a great hack to have, but we should limit applying it to as small a scope as possible. I like that with this approach:
|
Hm, yeah… as @isaacs pointed out in #12 (comment), the question of the scope of this fix is not easy. I’d tentatively agree with the behaviour that #13 seeks to achieve, namely that any script with a shebang invoking the |
Also, just btw, if you run |
Um, I just saw these files from the npm-cli repo: bin/npm bin/npm.cmd. I don’t really know what’s up with them, but I imagine there are cases where these are used when |
I think I'd like to land #12 and #13. (That is, handle absolute shebang but also special case for "npm".) Reading and parsing the bash exec junk seems like a step too far. I also plan to make the case for removing this hack from the node installer. It's overreaching. If someone out there really wants |
@addaleax those files are only installed on Windows I believe. |
working from:
#12
fixes shebang handling on Node 5.8.x
looks to be almost identical to:
https://github.com/tapjs/spawn-wrap/pull/13/files
so I'll let @isaacs decide what we land.