aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2014-06-15 02:52:17 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2014-06-15 02:52:17 -0700
commit3af36df80d999f36aa5aaff1d9889466c85971e5 (patch)
tree858337a7864ca135c04129110e71e90509bb7778
parent7cfb8b9ca2e66a79bb30e4762277dc3020aec70e (diff)
downloadrbpm-3af36df80d999f36aa5aaff1d9889466c85971e5.tar.gz
rbpm-3af36df80d999f36aa5aaff1d9889466c85971e5.tar.xz
More refactoring.
-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[*]}")"
}