diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2014-06-15 02:52:17 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2014-06-15 02:52:17 -0700 |
commit | 3af36df80d999f36aa5aaff1d9889466c85971e5 (patch) | |
tree | 858337a7864ca135c04129110e71e90509bb7778 /rpath.sh | |
parent | 7cfb8b9ca2e66a79bb30e4762277dc3020aec70e (diff) | |
download | rbpm-3af36df80d999f36aa5aaff1d9889466c85971e5.tar.gz rbpm-3af36df80d999f36aa5aaff1d9889466c85971e5.tar.xz |
More refactoring.
Diffstat (limited to 'rpath.sh')
-rwxr-xr-x | rpath.sh | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -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[*]}")" } |