mirror of
https://github.com/asdf-vm/asdf-nodejs.git
synced 2024-10-06 07:42:08 +08:00
7b6df2d0c6
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.
16 lines
268 B
Bash
Executable File
16 lines
268 B
Bash
Executable File
#!/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"
|