aboutsummaryrefslogtreecommitdiff
path: root/rpath.sh
diff options
context:
space:
mode:
Diffstat (limited to 'rpath.sh')
-rwxr-xr-xrpath.sh8
1 files changed, 3 insertions, 5 deletions
diff --git a/rpath.sh b/rpath.sh
index 0efaf44..da15706 100755
--- a/rpath.sh
+++ b/rpath.sh
@@ -75,7 +75,7 @@ _populate_selected() {
fi
done
- [[ -n ${selected} ]] || return 1
+ [[ -n "${selected}" ]] || return 1
[[ "${#selected[@]}" -eq 1 ]] \
|| _warn 'warning: multiple rubies found in PATH.'
@@ -89,21 +89,19 @@ _set() {
}
_clear() {
- local dir dirs cdirs succeed=false
+ local dir dirs cdirs
IFS=':' read -a dirs <<< "${PATH}"
for dir in "${dirs[@]}"; do
if [[ "${dir}" == "${RUBIES_PATH}/"* ]]; then
_echo "Removing ${dir} from PATH."
-
- succeed=true
else
cdirs+=("${dir}")
fi
done
- $succeed || return 1
+ [[ "${#cdirs[@]}" -ne "${#dirs[@]}" ]] || return 1
PATH="$(IFS=':'; echo "${cdirs[*]}")"
}