mirror of
https://github.com/asdf-vm/asdf-nodejs.git
synced 2024-10-06 07:42:08 +08:00
Fix Issue #56: Can't install latest version of npm globally
This works in tandom with a change in asdf core that will look for the exec-path command and use it appropriately when found to conditionally route the npm & npx commands to the correct executable path.
This commit is contained in:
parent
7edd9d6b9a
commit
7b6df2d0c6
15
bin/exec-path
Executable file
15
bin/exec-path
Executable file
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
install_path=$1
|
||||
cmd=$2
|
||||
executable_path=$3
|
||||
|
||||
if [[ "$cmd" == "npm" ]] || [[ "$cmd" == "npx" ]]; then
|
||||
npm_bin_cmd=".npm/bin/$cmd"
|
||||
|
||||
if [[ -f "$install_path/$npm_bin_cmd" ]]; then
|
||||
executable_path="$npm_bin_cmd"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "$executable_path"
|
Loading…
Reference in New Issue
Block a user