scripts/manage in rvm-0.1.44 vs scripts/manage in rvm-0.1.45

- old
+ new

@@ -714,10 +714,15 @@ rm -rf "$rvm_ruby_src_path" if [[ ! -d "$rvm_ruby_repo_path/.git" ]] ; then rm -rf "$rvm_ruby_repo_path" builtin cd "$rvm_home" __rvm_run "$1.repo" "git clone --depth 1 $rvm_ruby_repo_url $rvm_ruby_repo_path" "Cloning $rvm_ruby_repo_url" + result=$? ; if [[ "$result" -gt 0 ]] ; then + rvm_ruby_repo_http_url="$(echo $rvm_ruby_repo_url | sed -e 's/git:/http:/')" + $rvm_scripts_path/log "info" "Could not fetch $rvm_ruby_repo_url - trying $rvm_ruby_repo_http_url" + __rvm_run "$1.repo" "git clone --depth 1 $rvm_ruby_repo_http_url $rvm_ruby_repo_path" "Cloning $rvm_ruby_repo_http_url" + fi else local branch="${2:-"master"}" builtin cd "$rvm_ruby_repo_path" __rvm_run "$1.repo" "git pull origin $branch" "Pulling from origin $branch" fi @@ -801,14 +806,19 @@ $rvm_scripts_path/log "error" "There has been an error while trying to checkout the source branch. Aborting the installation." ; __rvm_pushpop ; return $result fi fi else rm -rf "$rvm_ruby_repo_path" + rvm_ruby_repo_http_url="$(echo $rvm_ruby_repo_url | sed -e 's/git:/http:/')" $rvm_scripts_path/log "info" "Cloning from $rvm_ruby_repo_url, this may take a while depending on your connection..." git clone --depth 1 "$rvm_ruby_repo_url" "$rvm_ruby_repo_path" result=$? ; if [[ "$result" -gt 0 ]] ; then - $rvm_scripts_path/log "error" "There has been an error while trying to fetch the repository. Aborting the installation." ; __rvm_pushpop ; return $result + $rvm_scripts_path/log "info" "cloning from $rvm_ruby_repo_url failed, now attempting to clone from $rvm_ruby_repo_http_url, this may take a while depending on your connection..." + git clone "$rvm_ruby_repo_http_url" "$rvm_ruby_repo_path" + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while trying to fetch the repository. Aborting the installation." ; __rvm_pushpop ; return $result + fi fi fi else if [[ -n "$rvm_ruby_tag" ]] ; then # TODO: Check if tag v is valid @@ -1003,14 +1013,14 @@ __rvm_irbrc __rvm_generate_default_docs if [[ -n "$rvm_ruby_aliases" ]]; then $rvm_scripts_path/log "info" "Setting up aliases for $rvm_ruby_string" - for ruby_alias in $rvm_ruby_aliases; do + while read -r ruby_alias; do $rvm_scripts_path/log info "Aliasing $rvm_ruby_string to $ruby_alias" $rvm_scripts_path/alias delete "$ruby_alias" > /dev/null 2>&1 $rvm_scripts_path/alias create "$ruby_alias" "$rvm_ruby_string" > /dev/null 2>&1 - done + done < <(echo "$rvm_ruby_string" | \tr ' ' '\n' | sort -u) unset rvm_ruby_aliases ruby_alias fi } __rvm_generate_default_docs() {