Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Bugfix: careful now.

  • Loading branch information...
commit d1350e89760ff9d38618ab4b5394b05b1a1d66a5 1 parent 7bef25d
@wayneeseguin wayneeseguin authored
Showing with 7 additions and 4 deletions.
  1. +2 −0  scripts/rvm
  2. +5 −4 scripts/utility
View
2  scripts/rvm
@@ -7,6 +7,8 @@
if [[ "$rvm_loaded_flag" != "1" ]] || [[ "$rvm_reload_flag" = "1" ]] ; then
unset rvm_reload_flag
+ mkdir -p $HOME/.gem/cache
+
if [[ -f /etc/rvmrc ]] ; then source /etc/rvmrc ; fi
if [[ -f "$HOME/.rvmrc" ]] ; then source "$HOME/.rvmrc" ; fi
View
9 scripts/utility
@@ -764,11 +764,12 @@ __rvm_gems_select() {
rvm_ruby_gem_path="$rvm_ruby_gem_home:$rvm_ruby_global_gems_path"
# TODO: Remove next section after a several releases.
- if [[ ! -d "$HOME/.gem/cache" ]] ; then mkdir -p $HOME/.gem/cache ; fi
# Migrate original rvm global gem cache directory to $HOME/.gem/cache
if [[ -d "$rvm_path/gems/cache" ]] && [[ ! -L "$rvm_path/gems/cache" ]] ; then
- mv "$rvm_path"/gems/cache/* $HOME/.gem/cache/
- rm -rf "$rvm_path"/gems/cache
+ if [[ ! -z "$(ls -A "$rvm_path"/gems/cache/)" ]] ; then
+ mv $rvm_path/gems/cache/* $HOME/.gem/cache/
+ fi
+ rmdir $rvm_path/gems/cache
fi
rm -f "$rvm_path/gems/cache"
ln -nfs "$HOME/.gem/cache" "$rvm_path/gems/cache"
@@ -785,7 +786,7 @@ __rvm_gems_select() {
if [[ ! -z "$(ls -A "$rvm_ruby_gem_home"/cache/)" ]] ; then
mv "$rvm_ruby_gem_home"/cache/* "$HOME"/.gem/cache/
fi
- rm -rf "$rvm_ruby_gem_home/cache"
+ rmdir "$rvm_ruby_gem_home"/cache
fi
# If the ruby's gems cache directory is not a symlink to the global cache, symlink it
Please sign in to comment.
Something went wrong with that request. Please try again.