ソースを参照

Use PWD variable instead of pwd shell built-in

In this case calling `pwd` is equivalent to reading `$PWD`, as there's
no use of `cd` inbetween subsequent calls to `pwd`, and we're not using
the `-P` switch to `pwd`.

Reading the variable is ever so slightly faster, as it doesn't fork a
sub-shell in which to execute the built-in.

Commit message: Graham Ashton
Michael Grosser 5 年 前
コミット
993f995a01
1 ファイル変更1 行追加1 行削除
  1. 1 1
      bundler-exec.sh

+ 1 - 1
bundler-exec.sh

@@ -13,7 +13,7 @@ bundler-installed()
 
 within-bundled-project()
 {
-    local dir="$(pwd)"
+    local dir="$PWD"
     while [ "$dir" != "/" ]; do
         if [ -f "$dir/Gemfile" ]; then
             return 0