scripts/rvm-install in rvm-0.0.25 vs scripts/rvm-install in rvm-0.0.26
- old
+ new
@@ -6,14 +6,17 @@
exit 1
fi
info="\n\033[0;32m<i>\033[0m"
question="\n\033[0;32m<?>\033[0m"
-
-echo -e "Installing rvm source to ~/.rvm/scripts/rvm..."
cwd=$(pwd)
+source_dir="${source_dir:-`dirname $0 | xargs dirname`}"
+if [ ! -d "$source_dir" ] ; then unset source_dir ; fi
+source_dir="${source_dir:-$cwd}"
rvm_dir=~/.rvm
+
+echo -e "Installing rvm source to ~/.rvm/scripts/rvm..."
mkdir -p $rvm_dir
for dir in src scripts bin log archives config gems examples ; do
mkdir -p $rvm_dir/$dir
done
@@ -30,11 +33,11 @@
rm -f ~/.rvm/bin/rvm
fi
for dir in scripts examples ; do
mkdir -p $rvm_dir/$dir
- for file in `/bin/ls $dir/`; do
- cp $cwd/$dir/$file $rvm_dir/$dir/$file
+ for file in `/bin/ls $source_dir/$dir/`; do
+ cp $source_dir/$dir/$file $rvm_dir/$dir/$file
done
done
# State what is required to use rvm
echo -e "\n\033[0;32mrvm\033[0m is a shell script that allows a user to manage multiple ruby versions in their own account."