File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff 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+
101110def subdir_files (path , dest , action ):
102111 ret = {}
103112 for dirpath , dirnames , filenames in os .walk (path ):
Original file line number Diff line number Diff line change 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" />
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" >
Original file line number Diff line number Diff line change 33# TODO Can we extract $PREFIX from the installer?
44cd /usr/local/bin
55ln -sf ../lib/node_modules/npm/bin/npm-cli.js npm
6+ ln -sf ../lib/node_modules/npm/bin/npx-cli.js npx
You can’t perform that action at this time.
0 commit comments