Browse Source

build: add npx to installers

PR-URL: https://github.com/nodejs/node/pull/14235
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
v6
Kat Marchán 8 years ago
committed by James M Snell
parent
commit
62779ae195
  1. 9
      tools/install.py
  2. 10
      tools/msvs/msi/product.wxs
  3. 1
      tools/osx-pkg-postinstall.sh

9
tools/install.py

@ -98,6 +98,15 @@ def npm_files(action):
else: else:
assert(0) # unhandled action type 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): def subdir_files(path, dest, action):
ret = {} ret = {}
for dirpath, dirnames, filenames in os.walk(path): for dirpath, dirnames, filenames in os.walk(path):

10
tools/msvs/msi/product.wxs

@ -95,6 +95,8 @@
Description="!(loc.npm_Description)"> Description="!(loc.npm_Description)">
<ComponentRef Id="NpmCmdScript"/> <ComponentRef Id="NpmCmdScript"/>
<ComponentRef Id="NpmBashScript"/> <ComponentRef Id="NpmBashScript"/>
<ComponentRef Id="NpxCmdScript"/>
<ComponentRef Id="NpxBashScript"/>
<ComponentRef Id="NpmConfigurationFile"/> <ComponentRef Id="NpmConfigurationFile"/>
<ComponentRef Id="AppData" /> <ComponentRef Id="AppData" />
<ComponentGroupRef Id="NpmSourceFiles"/> <ComponentGroupRef Id="NpmSourceFiles"/>
@ -215,6 +217,14 @@
<File Id="npm.sh" KeyPath="yes" Source="$(var.NpmSourceDir)\bin\npm"/> <File Id="npm.sh" KeyPath="yes" Source="$(var.NpmSourceDir)\bin\npm"/>
</Component> </Component>
<Component Id="NpxCmdScript">
<File Id="npx.cmd" KeyPath="yes" Source="$(var.NpmSourceDir)\bin\npx.cmd"/>
</Component>
<Component Id="NpxBashScript">
<File Id="npx.sh" KeyPath="yes" Source="$(var.NpmSourceDir)\bin\npx"/>
</Component>
<Directory Id="NodeModulesFolder" Name="node_modules"> <Directory Id="NodeModulesFolder" Name="node_modules">
<Directory Id="NpmFolder" Name="npm"> <Directory Id="NpmFolder" Name="npm">
<Component Id="NpmConfigurationFile"> <Component Id="NpmConfigurationFile">

1
tools/osx-pkg-postinstall.sh

@ -3,3 +3,4 @@
# TODO Can we extract $PREFIX from the installer? # TODO Can we extract $PREFIX from the installer?
cd /usr/local/bin cd /usr/local/bin
ln -sf ../lib/node_modules/npm/bin/npm-cli.js npm ln -sf ../lib/node_modules/npm/bin/npm-cli.js npm
ln -sf ../lib/node_modules/npm/bin/npx-cli.js npx

Loading…
Cancel
Save