Skip to content

Commit

Permalink
extract old hooks, remove unecessary check if installation directory …
Browse files Browse the repository at this point in the history
…exist, update #2634
  • Loading branch information
mpapis committed Feb 25, 2014
1 parent e77ba4d commit 2f9edd1
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions scripts/functions/installer
Expand Up @@ -73,6 +73,7 @@ install_rvm()
install_rvm_files
cleanup_old_help_and_docs_files
install_rvm_hooks
remove_old_hooks
install_binaries
install_gemsets
install_patchsets
Expand Down Expand Up @@ -446,7 +447,7 @@ install_rvm_files()
[[ -f "$source_path/$entry" ]] &&
[[ "$entry" == "scripts/extras/completion.zsh/_rvm" || "$entry" == "scripts/zsh/Completion/_rvm" ]]
then
if __rvm_rm_rf "$rvm_path/$entry" 2>/dev/null
if [[ ! -f "$rvm_path/$entry" ]] || __rvm_rm_rf "$rvm_path/$entry" 2>/dev/null
then __rvm_cp -f "$source_path/$entry" "$rvm_path/$entry"
else rvm_log " Can not update '$entry', it's a conflict between Zsh and multiuser installation, prefix the command with 'rvmsudo' to update this file."
fi
Expand Down Expand Up @@ -517,8 +518,10 @@ install_rvm_hooks()
[[ -d "$rvm_path/$entry" ]] || mkdir -p "$rvm_path/$entry"
fi
done
}

#remove unneeded files
remove_old_hooks()
{
for entry in after_use_custom after_use after_cd
do
name=${entry#after_}
Expand Down Expand Up @@ -606,10 +609,7 @@ install_gemsets()
then __rvm_find "$rvm_path/gemsets" -type f -delete
fi

if
[[ -d gemsets/ ]]
then
[[ -d "$rvm_path/gemsets" ]] || mkdir -p "$rvm_path/gemsets"
[[ -d "$rvm_path/gemsets" ]] || mkdir -p "$rvm_path/gemsets"

__rvm_read_lines gemset_files <(
__rvm_find "${PWD%%+(\/)}/gemsets" "${name_opt}" '*.gems' |
Expand All @@ -628,7 +628,6 @@ install_gemsets()
< "$gemset_file" > "$destination"
fi
done
fi

update_gemsets_rvmrc rvm_without_gems "${rvm_without_gems}"
update_gemsets_rvmrc rvm_with_gems "${rvm_with_gems}"
Expand Down

0 comments on commit 2f9edd1

Please sign in to comment.