瀏覽代碼

Merge pull request #819 from blueyed/fix-path_without

tests: fix path_without to handle /bin properly
pull/487/head^2
Mislav Marohnić 8 年之前
父節點
當前提交
fcedf169fb
共有 1 個檔案被更改,包括 3 行新增2 行删除
  1. +3
    -2
      test/test_helper.bash

+ 3
- 2
test/test_helper.bash 查看文件

@ -111,7 +111,7 @@ assert() {
# but in which system utils necessary for rbenv operation are still available.
path_without() {
local exe="$1"
local path="${PATH}:"
local path=":${PATH}:"
local found alt util
for found in $(which -a "$exe"); do
found="${found%/*}"
@ -123,8 +123,9 @@ path_without() {
ln -s "${found}/$util" "${alt}/$util"
fi
done
path="${path/${found}:/${alt}:}"
path="${path/:${found}:/:${alt}:}"
fi
done
path="${path#:}"
echo "${path%:}"
}

Loading…
取消
儲存