summaryrefslogtreecommitdiff
path: root/tools/install.py
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2015-01-08 14:21:26 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2015-01-08 23:21:23 +0100
commit72f1b348b021269f98783aee2f0e89500a20231c (patch)
tree2f94b47bad380c4d1919666fa320a1d69349677b /tools/install.py
parentf17f473af5e28f4ec00a518f97a84b69c426309e (diff)
downloadandroid-node-v8-72f1b348b021269f98783aee2f0e89500a20231c.tar.gz
android-node-v8-72f1b348b021269f98783aee2f0e89500a20231c.tar.bz2
android-node-v8-72f1b348b021269f98783aee2f0e89500a20231c.zip
install: install iojs -> node compat symlink
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: https://github.com/iojs/io.js/pull/262 Reviewed-By: Bert Belder <bertbelder@gmail.com>
Diffstat (limited to 'tools/install.py')
-rwxr-xr-xtools/install.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/install.py b/tools/install.py
index affce2265c..5cf78b5281 100755
--- a/tools/install.py
+++ b/tools/install.py
@@ -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')