1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-16 07:13:53 -05:00

Merge pull request #81 from eric/empty_path_to_remove_in_which

Deal with an empty result from expand_path
This commit is contained in:
Joshua Peek
2011-09-09 15:05:34 -07:00

View File

@@ -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