Skip to content

Commit

Permalink
Bugfix: unbound variable in cli.
Browse files Browse the repository at this point in the history
  • Loading branch information
wayneeseguin committed May 18, 2011
1 parent 5ba0a13 commit 64119b4
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 7 deletions.
16 changes: 13 additions & 3 deletions scripts/cli
Expand Up @@ -835,9 +835,19 @@ rvm()

help|rtfm|env|current|info|list|gemdir|gemhome|gempath|monitor|notes|package)

if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi
if [[ "$next_token" = "${rvm_action}" ]]; then shift; fi
"$rvm_scripts_path/${rvm_action}" $rvm_ruby_args
if (( $# > 0 ))
then
next_token="$1"
shift
else
next_token=""
fi

if [[ "$next_token" = "${rvm_action}" ]]
then
shift
fi
"$rvm_scripts_path/${rvm_action}" ${rvm_ruby_args:-}
;;

cleanup|tools|snapshot|disk-usage|repair|alias|docs|rubygems|migrate|upgrade)
Expand Down
10 changes: 8 additions & 2 deletions scripts/manage
Expand Up @@ -1207,7 +1207,10 @@ __rvm_fetch_from_github()

if [[ ! -d "${rvm_repos_path}/$rvm_ruby_string/.git" ]]
then
__rvm_rm_rf "${rvm_repos_path}/$rvm_ruby_string"
if [[ -n "${rvm_ruby_string}" ]]
then
__rvm_rm_rf "${rvm_repos_path}/$rvm_ruby_string"
fi

builtin cd "$rvm_home"

Expand Down Expand Up @@ -1251,7 +1254,10 @@ __rvm_fetch_from_github()
fi
)

__rvm_rm_rf "${rvm_src_path}/$rvm_ruby_string"
if [[ -n "${rvm_ruby_string}" ]]
then
__rvm_rm_rf "${rvm_src_path}/$rvm_ruby_string"
fi

__rvm_run "$1.copy" "\\cp -Rf \"${rvm_repos_path}/${rvm_ruby_string}/\" \"${rvm_src_path}/$rvm_ruby_string\"" "Copying from repo to source..."

Expand Down
19 changes: 17 additions & 2 deletions scripts/selector
Expand Up @@ -79,6 +79,16 @@ __rvm_select()
rvm_ruby_version=${rvm_ruby_version:-$(__rvm_db "rbx_version")}
rvm_ruby_repo_url=${rvm_rbx_repo_url:-$(__rvm_db "rubinius_repo_url")}

#
# rbx,rbx-head => master
# rbx-* => * is a remote branch, eg rbx-master, rbx-2.0pre
# rbx-t1.2.3 => tag 1.2.3 of master branch
#
if [[ "${rvm_ruby_version}" = "2.0pre" ]]
then
rvm_ruby_repo_branch="hydra"
fi

if (( ${rvm_head_flag:=0} == 0 ))
then
rvm_ruby_patch_level=${rvm_ruby_patch_level:-$(
Expand Down Expand Up @@ -743,8 +753,13 @@ __rvm_ruby_string()
rvm_ruby_user_tag="$string"
;;

b[[:digit:]][[:digit:]]*)
rvm_ruby_bits="$string"
a[[:digit:]][[:digit:]]*)
rvm_ruby_bits="$string" # Architecture
;;

b[[:digit:]]*)
rvm_ruby_repo_branch="${string}"
rvm_head_flag=1
;;

ruby|rbx|jruby|macruby|ree|kiji|rubinius|maglev|ironruby|goruby)
Expand Down

0 comments on commit 64119b4

Please sign in to comment.