Skip to content

Commit

Permalink
build: add npx to installers
Browse files Browse the repository at this point in the history
PR-URL: #14235
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
zkat authored and addaleax committed Jul 18, 2017
1 parent dc3f6b9 commit 6b052e7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tools/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
10 changes: 10 additions & 0 deletions tools/msvs/msi/product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@
Description="!(loc.npm_Description)">
<ComponentRef Id="NpmCmdScript"/>
<ComponentRef Id="NpmBashScript"/>
<ComponentRef Id="NpxCmdScript"/>
<ComponentRef Id="NpxBashScript"/>
<ComponentRef Id="NpmConfigurationFile"/>
<ComponentRef Id="AppData" />
<ComponentGroupRef Id="NpmSourceFiles"/>
Expand Down Expand Up @@ -215,6 +217,14 @@
<File Id="npm.sh" KeyPath="yes" Source="$(var.NpmSourceDir)\bin\npm"/>
</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="NpmFolder" Name="npm">
<Component Id="NpmConfigurationFile">
Expand Down
1 change: 1 addition & 0 deletions tools/osx-pkg-postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 6b052e7

Please sign in to comment.