diff options
Diffstat (limited to 'eselect-ruby/ruby.eselect')
-rw-r--r-- | eselect-ruby/ruby.eselect | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/eselect-ruby/ruby.eselect b/eselect-ruby/ruby.eselect index 85cb5eb..e40246b 100644 --- a/eselect-ruby/ruby.eselect +++ b/eselect-ruby/ruby.eselect @@ -24,17 +24,17 @@ check_target() { # number from the list if is_number ${target} && [[ ${target} -ge 1 ]] ; then if [[ ${target} -gt ${#targets[@]} ]] ; then - die -q "Can't use that profile. No suitable Ruby interpreter found." + target="invalid" elif [[ -e "${targets[$(( ${target} - 1 ))]}" ]] ; then target=$(basename ${targets[$((${target} - 1 ))]} ) else write_warning_msg ${targets[$((${target} - 1 ))]} - die -q "Can't use that profile. No suitable Ruby interpreter found." + target="invalid" fi # `rubyXX' string else [[ -e "${ROOT}${bindir}/${target}" ]] || \ - die -q "Can't use that profile. No suitable Ruby interpreter found." + target="invalid" fi echo ${target} @@ -130,7 +130,7 @@ do_list() { write_list_start "Available Ruby profiles:" local targets=( $(find_targets ) ) - if [[ -n ${#targets[@]} ]] ; then + if [[ ${#targets[@]} -ne 0 ]] ; then local i for (( i = 0 ; i < ${#targets[@]} ; i = i + 1 )) ; do local line="$(basename ${targets[${i}]} )" @@ -172,6 +172,8 @@ do_set() { local target=$(check_target ${1}) + [[ $target = "invalid" ]] && die -q "Can't use that profile. No suitable Ruby interpreter found." + remove_symlinks || \ die -q "Could not remove symlinks" |