Skip to content

Commit 6b052e7

Browse files
zkataddaleax
authored andcommitted
build: add npx to installers
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]>
1 parent dc3f6b9 commit 6b052e7

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

tools/install.py

+9
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,15 @@ def npm_files(action):
9898
else:
9999
assert(0) # unhandled action type
100100

101+
# create/remove symlink
102+
link_path = abspath(install_path, 'bin/npx')
103+
if action == uninstall:
104+
action([link_path], 'bin/npx')
105+
elif action == install:
106+
try_symlink('../lib/node_modules/npm/bin/npx-cli.js', link_path)
107+
else:
108+
assert(0) # unhandled action type
109+
101110
def subdir_files(path, dest, action):
102111
ret = {}
103112
for dirpath, dirnames, filenames in os.walk(path):

tools/msvs/msi/product.wxs

+10
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@
9595
Description="!(loc.npm_Description)">
9696
<ComponentRef Id="NpmCmdScript"/>
9797
<ComponentRef Id="NpmBashScript"/>
98+
<ComponentRef Id="NpxCmdScript"/>
99+
<ComponentRef Id="NpxBashScript"/>
98100
<ComponentRef Id="NpmConfigurationFile"/>
99101
<ComponentRef Id="AppData" />
100102
<ComponentGroupRef Id="NpmSourceFiles"/>
@@ -215,6 +217,14 @@
215217
<File Id="npm.sh" KeyPath="yes" Source="$(var.NpmSourceDir)\bin\npm"/>
216218
</Component>
217219

220+
<Component Id="NpxCmdScript">
221+
<File Id="npx.cmd" KeyPath="yes" Source="$(var.NpmSourceDir)\bin\npx.cmd"/>
222+
</Component>
223+
224+
<Component Id="NpxBashScript">
225+
<File Id="npx.sh" KeyPath="yes" Source="$(var.NpmSourceDir)\bin\npx"/>
226+
</Component>
227+
218228
<Directory Id="NodeModulesFolder" Name="node_modules">
219229
<Directory Id="NpmFolder" Name="npm">
220230
<Component Id="NpmConfigurationFile">

tools/osx-pkg-postinstall.sh

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
# TODO Can we extract $PREFIX from the installer?
44
cd /usr/local/bin
55
ln -sf ../lib/node_modules/npm/bin/npm-cli.js npm
6+
ln -sf ../lib/node_modules/npm/bin/npx-cli.js npx

0 commit comments

Comments
 (0)