Permalink
Browse files

Tweaked installer for new binscript.

  • Loading branch information...
1 parent 46779a1 commit b61b4babe7fe7235d7f27c0279b5c9aebe0358c9 @wayneeseguin wayneeseguin committed Dec 2, 2009
Showing with 24 additions and 7 deletions.
  1. +18 −0 binscripts/rvm
  2. +3 −1 scripts/cli
  3. +3 −6 scripts/install
View
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+
+if [[ -f /etc/rvmrc ]] ; then source /etc/rvmrc ; fi
+if [[ -f "$HOME/.rvmrc" ]] ; then source "$HOME/.rvmrc" ; fi
+if [[ -z "$rvm_path" ]] ; then unset rvm_path ; fi
+
+if [[ -z "$rvm_path" ]] ; then
+ if [[ "root" = "$(whoami)" ]] ; then
+ rvm_path="${rvm_path:-/usr/local/rvm}"
+ else
+ rvm_path="${rvm_path:-$HOME/.rvm}"
+ fi
+fi
+
+source $rvm_path/scripts/rvm
+
+__rvm "$*"
+
View
@@ -334,7 +334,9 @@ __rvm_parse_args() {
if [[ ! -z "$rvm_error_message" ]] ; then __rvm_pushpop ; return 1 ; fi
}
-rvm() {
+rvm() { __rvm "$*" ; }
+
+__rvm() {
trap '__rvm_cleanup_variables ; rm -rf "/tmp/rvm/$$" >/dev/null 2>&1' 0 1 2 3 15
# Check that this is the current version.
View
@@ -48,9 +48,9 @@ done ; unset dir_name
# Bin Scripts
#
echo -e "\n Installing bin scripts to $rvm_path/bin ..."
+rm -f $rvm_path/bin/rvm # Cleanse and purge...
cp -Rf "$source_dir/binscripts/" $rvm_path/bin
chmod +x $rvm_path/bin/*
-ln -nfs $rvm_path/scripts/rvm $rvm_path/bin/rvm
#
# RC Files
@@ -68,12 +68,9 @@ fi
if [[ "root" = "$(whoami)" ]] ; then
echo -e "\n Symlinking rvm to $rvm_symlink_path/rvm ..."
- ln -nfs $rvm_path/scripts/rvm $rvm_symlink_path/rvm
-else
- echo -e "\n Symlinking rvm to $rvm_path/bin/rvm ..."
- ln -nfs $rvm_path/scripts/rvm $rvm_path/bin/rvm
+ ln -nfs $rvm_path/bin/rvm $rvm_symlink_path/rvm
+ chmod +x $rvm_symlink_path/rvm
fi
-chmod +x $rvm_path/scripts/rvm
#
# System Checks

0 comments on commit b61b4ba

Please sign in to comment.