Pārlūkot izejas kodu

Merge pull request #81 from eric/empty_path_to_remove_in_which

Deal with an empty result from expand_path
pull/360/head^2
Joshua Peek pirms 13 gadiem
vecāks
revīzija
5ad45afe5e
1 mainītis faili ar 5 papildinājumiem un 0 dzēšanām
  1. +5
    -0
      libexec/rbenv-which

+ 5
- 0
libexec/rbenv-which Parādīt failu

@ -16,6 +16,11 @@ remove_from_path() {
local path_to_remove="$(expand_path "$1")"
local result=""
if [ -z "$path_to_remove" ]; then
echo "${PATH}"
return
fi
for path in ${PATH//:/$'\n'}; do
path="$(expand_path "$path" || true)"
if [ -n "$path" ] && [ "$path" != "$path_to_remove" ]; then

Notiek ielāde…
Atcelt
Saglabāt