From 6b052e7c4204810f70f3a08fad82c29f1a71acec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Mon, 10 Jul 2017 18:53:58 -0700 Subject: [PATCH] build: add npx to installers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/14235 Reviewed-By: Jeremiah Senkpiel Reviewed-By: Refael Ackermann Reviewed-By: Anna Henningsen Reviewed-By: Yuta Hiroto Reviewed-By: Gibson Fahnestock Reviewed-By: Tobias Nießen Reviewed-By: James M Snell --- tools/install.py | 9 +++++++++ tools/msvs/msi/product.wxs | 10 ++++++++++ tools/osx-pkg-postinstall.sh | 1 + 3 files changed, 20 insertions(+) diff --git a/tools/install.py b/tools/install.py index d51ac06d7b10dd..afebb60e994597 100755 --- a/tools/install.py +++ b/tools/install.py @@ -98,6 +98,15 @@ def npm_files(action): else: assert(0) # unhandled action type + # create/remove symlink + link_path = abspath(install_path, 'bin/npx') + if action == uninstall: + action([link_path], 'bin/npx') + elif action == install: + try_symlink('../lib/node_modules/npm/bin/npx-cli.js', link_path) + else: + assert(0) # unhandled action type + def subdir_files(path, dest, action): ret = {} for dirpath, dirnames, filenames in os.walk(path): diff --git a/tools/msvs/msi/product.wxs b/tools/msvs/msi/product.wxs index a21a3bb3ef1659..c8a89d725509db 100755 --- a/tools/msvs/msi/product.wxs +++ b/tools/msvs/msi/product.wxs @@ -95,6 +95,8 @@ Description="!(loc.npm_Description)"> + + @@ -215,6 +217,14 @@ + + + + + + + + diff --git a/tools/osx-pkg-postinstall.sh b/tools/osx-pkg-postinstall.sh index c4c872fc785493..8212c27f8e870a 100644 --- a/tools/osx-pkg-postinstall.sh +++ b/tools/osx-pkg-postinstall.sh @@ -3,3 +3,4 @@ # TODO Can we extract $PREFIX from the installer? cd /usr/local/bin ln -sf ../lib/node_modules/npm/bin/npm-cli.js npm +ln -sf ../lib/node_modules/npm/bin/npx-cli.js npx