Skip to content

Commit

Permalink
Fix Issue #56: Can't install latest version of npm globally
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
andrewthauer committed Apr 26, 2018
1 parent 7edd9d6 commit 7b6df2d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions bin/exec-path
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 7b6df2d

Please sign in to comment.