diff --git a/plugins/npm-path/npm-path.plugin.zsh b/plugins/npm-path/npm-path.plugin.zsh new file mode 100644 index 000000000..1b74fb5e7 --- /dev/null +++ b/plugins/npm-path/npm-path.plugin.zsh @@ -0,0 +1,15 @@ +zsh-npm-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-npm-path"