Browse Source

Check for node before using it

pull/2/head
Luke Childs 8 years ago
parent
commit
d74a905d30
  1. 2
      npm-run-completion.zsh

2
npm-run-completion.zsh

@ -7,7 +7,7 @@ _npm_run_completion() {
break
fi
done
if [ ! "$dir" = "" ]; then
if [ ! "$dir" = "" ] && type node > /dev/null; then
local options=("${(@f)$(node -e "var pkg = require('$dir/$filename'); pkg.scripts && Object.keys(pkg.scripts).forEach(function(script) { console.log(script.replace(':', '\\\:')+':$ '+pkg.scripts[script]) })")}")
_describe 'values' options
fi

Loading…
Cancel
Save