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"
dir=$PWD
while [ ! -e "$dir/$filename" ]; do
dir=${dir%/*}
if [ "$dir" = "" ]; then
break;
_npm_run_completion() {
local filename="package.json"
local dir=$PWD
while [ ! -e "$dir/$filename" ]; do
dir=${dir%/*}
if [ "$dir" = "" ]; then
break;
fi
done
if [ ! "$dir" = "" ]; then
echo "$dir/$filename";
fi
done
if [ ! "$dir" = "" ]; then
echo "$dir/$filename";
fi
}

Loading…
Cancel
Save