Skip to content

Commit

Permalink
install: install iojs -> node compat symlink
Browse files Browse the repository at this point in the history
Install a symlink for compatibility with scripts that expect a binary
called `node` or have a /path/to/node shebang.  Only done on UNIX
platforms because symlinks on Windows require elevated privileges.

PR-URL: #262
Reviewed-By: Bert Belder <[email protected]>
  • Loading branch information
bnoordhuis committed Jan 8, 2015
1 parent f17f473 commit 72f1b34
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tools/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,22 @@ def subdir_files(path, dest, action):
action(files, subdir + '/')

def files(action):
exeext = '.exe' if sys.platform == 'win32' else ''
is_windows = sys.platform == 'win32'

exeext = '.exe' if is_windows else ''
action(['out/Release/iojs' + exeext], 'bin/iojs' + exeext)

if not is_windows:
# Install iojs -> node compatibility symlink.
link_target = 'bin/node'
link_path = abspath(install_path, link_target)
if action == uninstall:
action([link_path], link_target)
elif action == install:
try_symlink('iojs', link_path)
else:
assert(0) # Unhandled action type.

if 'true' == variables.get('node_use_dtrace'):
action(['out/Release/node.d'], 'lib/dtrace/node.d')

Expand Down

0 comments on commit 72f1b34

Please sign in to comment.