summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorEvan Lucas <evanlucas@me.com>2016-04-07 06:27:41 -0500
committerJames M Snell <jasnell@gmail.com>2016-04-26 12:15:54 -0700
commit102a77655a87ba90fbffb9f67fe84a3486cd89cd (patch)
tree65af2157e1233fa49e6f8b4178663ac41c00babf /tools
parentc4518abac3be818fe2553f296d2fec03548c4c30 (diff)
downloadnode-new-102a77655a87ba90fbffb9f67fe84a3486cd89cd.tar.gz
tools: do not rewrite npm shebang in install.py
Rewriting npm shebang in install.py violates user expectations among other things. The shebang in npm.js is kept as #!/usr/bin/env node. Fixes: https://github.com/nodejs/node/issues/6095 PR-URL: https://github.com/nodejs/node/pull/6098 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/install.py16
1 files changed, 0 insertions, 16 deletions
diff --git a/tools/install.py b/tools/install.py
index 6c3570fa75..d92e656369 100755
--- a/tools/install.py
+++ b/tools/install.py
@@ -79,12 +79,6 @@ def try_remove(path, dst):
def install(paths, dst): map(lambda path: try_copy(path, dst), paths)
def uninstall(paths, dst): map(lambda path: try_remove(path, dst), paths)
-def update_shebang(path, shebang):
- print 'updating shebang of %s to %s' % (path, shebang)
- s = open(path, 'r').read()
- s = re.sub(r'#!.*\n', '#!' + shebang + '\n', s)
- open(path, 'w').write(s)
-
def npm_files(action):
target_path = 'lib/node_modules/npm/'
@@ -105,16 +99,6 @@ def npm_files(action):
action([link_path], 'bin/npm')
elif action == install:
try_symlink('../lib/node_modules/npm/bin/npm-cli.js', link_path)
- if os.environ.get('PORTABLE'):
- # This crazy hack is necessary to make the shebang execute the copy
- # of node relative to the same directory as the npm script. The precompiled
- # binary tarballs use a prefix of "/" which gets translated to "/bin/node"
- # in the regular shebang modifying logic, which is incorrect since the
- # precompiled bundle should be able to be extracted anywhere and "just work"
- shebang = '/bin/sh\n// 2>/dev/null; exec "`dirname "$0"`/node" "$0" "$@"'
- else:
- shebang = os.path.join(node_prefix or '/', 'bin/node')
- update_shebang(link_path, shebang)
else:
assert(0) # unhandled action type