diff options
author | Nathan Rajlich <nathan@tootallnate.net> | 2012-08-04 11:12:52 +0400 |
---|---|---|
committer | Nathan Rajlich <nathan@tootallnate.net> | 2012-08-06 01:02:30 +0400 |
commit | 3254caceefda268247826cd9bb8178725a9f0b08 (patch) | |
tree | 507a86fed9725a1910df478feb53f01f5ee91c1d /tools | |
parent | 57f785151aa68b1d01c6ca1b08be379fc5e8b538 (diff) |
install: use os.path.join() to create the npm shebang
Prettier formatting for the shebang if the "prefix" ends with a /
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/install.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/install.py b/tools/install.py index 2ee9903824e..988626f2038 100755 --- a/tools/install.py +++ b/tools/install.py @@ -128,7 +128,7 @@ def waf_files(action): 'lib/node/wafadmin/') def update_shebang(path, shebang): - print 'updating shebang of %s' % path + 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) @@ -153,7 +153,8 @@ def npm_files(action): action([link_path], 'bin/npm') elif action == install: try_symlink('../lib/node_modules/npm/bin/npm-cli.js', link_path) - update_shebang(link_path, node_prefix + '/bin/node') + shebang = os.path.join(node_prefix, 'bin/node') + update_shebang(link_path, shebang) else: assert(0) # unhandled action type |