Skip to content

Commit

Permalink
Tweaked installer for new binscript.
Browse files Browse the repository at this point in the history
  • Loading branch information
wayneeseguin committed Dec 2, 2009
1 parent 46779a1 commit b61b4ba
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
18 changes: 18 additions & 0 deletions binscripts/rvm
@@ -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 "$*"

4 changes: 3 additions & 1 deletion scripts/cli
Expand Up @@ -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.
Expand Down
9 changes: 3 additions & 6 deletions scripts/install
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit b61b4ba

Please sign in to comment.