Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
build: add npx to installers
  • Loading branch information
zkat committed Jul 14, 2017
commit 6029975c50adcc02436d50915ebee6e15d92d156
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