Browse Source

Wrap code in function

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

6
npm-run-completion.zsh

@ -1,5 +1,6 @@
filename="package.json" _npm_run_completion() {
dir=$PWD local filename="package.json"
local dir=$PWD
while [ ! -e "$dir/$filename" ]; do while [ ! -e "$dir/$filename" ]; do
dir=${dir%/*} dir=${dir%/*}
if [ "$dir" = "" ]; then if [ "$dir" = "" ]; then
@ -9,3 +10,4 @@ done
if [ ! "$dir" = "" ]; then if [ ! "$dir" = "" ]; then
echo "$dir/$filename"; echo "$dir/$filename";
fi fi
}

Loading…
Cancel
Save