oh-my-fish/plugins/node/node.load

24 lines
501 B
Fish
Raw Normal View History

if test -d /usr/local/share/npm/bin
set PATH /usr/local/share/npm/bin $PATH
end
2013-03-10 14:08:11 +08:00
function __check_node_project --on-variable PWD --description 'Setup local npm binaries on directory change'
status --is-command-substitution; and return
set -l count 1
for path in $PATH
if echo $path | grep 'node_module' >/dev/null
set -e PATH[$count]
else
set count (math $count + 1)
end
end
for path in $PWD/node_modules/*/bin
set PATH $path $PATH
end
set -e count
end