ohmyzsh/plugins/npm-path/npm-path.plugin.zsh
2015-07-10 04:58:47 +03:00

15 lines
408 B
Bash

zsh-node_modules-bin-update-path() {
if [[ ! -x $(which npm) ]]; then
# there is no npm
return
fi
if [[ ! -r $(which npm-path) ]]; then
echo "WARNING: npm-path must be available for the oh-my-zshell npm-path module to update your PATH. Perhaps \`npm --global install npm-path\` will help."
return
fi
export PATH=$(npm-path)
}
precmd_functions+="zsh-node_modules-bin-update-path"