Browse Source

Wrap code in function

pull/2/head
Luke Childs 9 years ago
parent
commit
af7f13f059
  1. 22
      npm-run-completion.zsh

22
npm-run-completion.zsh

@ -1,11 +1,13 @@
filename="package.json" _npm_run_completion() {
dir=$PWD local filename="package.json"
while [ ! -e "$dir/$filename" ]; do local dir=$PWD
dir=${dir%/*} while [ ! -e "$dir/$filename" ]; do
if [ "$dir" = "" ]; then dir=${dir%/*}
break; if [ "$dir" = "" ]; then
break;
fi
done
if [ ! "$dir" = "" ]; then
echo "$dir/$filename";
fi fi
done }
if [ ! "$dir" = "" ]; then
echo "$dir/$filename";
fi

Loading…
Cancel
Save