1
0
Эх сурвалжийг харах

Be consistent when setting return value of function

It's what the `return` built-in is for, so let's use it.

Commit message: Graham Ashton
Michael Grosser 5 жил өмнө
parent
commit
8fa2c5d141
1 өөрчлөгдсөн 5 нэмэгдсэн , 3 устгасан
  1. 5 3
      bundler-exec.sh

+ 5 - 3
bundler-exec.sh

@@ -14,11 +14,13 @@ bundler-installed()
 within-bundled-project()
 {
     local dir="$(pwd)"
-    while [ "$(dirname $dir)" != "/" ]; do
-        [ -f "$dir/Gemfile" ] && return
+    while [ "$dir" != "/" ]; do
+        if [ -f "$dir/Gemfile" ]; then
+            return 0
+        fi
         dir="$(dirname $dir)"
     done
-    false
+    return 1
 }
 
 run-with-bundler()