mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -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:
commit
5ad45afe5e
1 changed files with 5 additions and 0 deletions
|
@ -16,6 +16,11 @@ remove_from_path() {
|
||||||
local path_to_remove="$(expand_path "$1")"
|
local path_to_remove="$(expand_path "$1")"
|
||||||
local result=""
|
local result=""
|
||||||
|
|
||||||
|
if [ -z "$path_to_remove" ]; then
|
||||||
|
echo "${PATH}"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
for path in ${PATH//:/$'\n'}; do
|
for path in ${PATH//:/$'\n'}; do
|
||||||
path="$(expand_path "$path" || true)"
|
path="$(expand_path "$path" || true)"
|
||||||
if [ -n "$path" ] && [ "$path" != "$path_to_remove" ]; then
|
if [ -n "$path" ] && [ "$path" != "$path_to_remove" ]; then
|
||||||
|
|
Loading…
Reference in a new issue