scripts/rvm-install in rvm-1.0.0 vs scripts/rvm-install in rvm-1.0.1
- old
+ new
@@ -1,7 +1,9 @@
#!/usr/bin/env bash
+#set -u # Error on uninitialized variables.
+
if [[ -z "$rvm_selfcontained" ]]; then
if [[ "root" = "$(whoami)" ]] || [[ -n "$rvm_prefix" && "$rvm_prefix" != "$HOME"/* ]]; then
export rvm_selfcontained=0
else
export rvm_selfcontained=1
@@ -13,10 +15,12 @@
install_source_path="$(dirname "$0" | sed 's#\/scripts$##')"
if [[ -d "$install_source_path/scripts" ]] && [[ -s "$install_source_path/scripts/utility" ]] ; then
builtin cd "$install_source_path"
fi
+sleep=0.010
+
source scripts/version
source scripts/utility
usage() {
printf "
@@ -42,21 +46,21 @@
spinner() {
array=('/' '-' '\\' '|' '/' '-' '\\' '|')
index=$((($spinner_counter % 8)))
printf "\r${array[$index]}"
let "spinner_counter=spinner_counter+1"
- command -v perl > /dev/null 2>&1 && perl -e 'sleep 0.5'
+ sleep $sleep
}
if echo "$*" | \grep -q 'trace' ; then echo "$*" ; env | \grep '^rvm_' ; set -x ; fi
while [[ $# -gt 0 ]] ; do
token="$1" ; shift
case "$token" in
--auto) rvm_auto_flag=1 ;;
--prefix) rvm_prefix="$1" ; shift ;;
- --version) rvm_path="$(pwd)" ; __rvm_version ; unset rvm_path ; exit ;;
+ --version) rvm_path="$PWD" ; __rvm_version ; unset rvm_path ; exit ;;
--help|*) usage ;;
esac
done
if [[ -z "$rvm_prefix" ]] ; then
@@ -87,11 +91,11 @@
#
# Setup & Configuration
#
item="$(tput setaf 2)* $(tput sgr0)"
question="\n$(tput setaf 2)<?>$(tput sgr0)"
-cwd=$(pwd)
+cwd=$PWD
source_path="${source_path:-$cwd}"
rvm_archives_path="${rvm_archives_path:-"$rvm_path/archives"}"
rvm_src_path="${rvm_src_path:-"$rvm_path/src"}"
rvm_log_path="${rvm_log_path:-"$rvm_path/log"}"
@@ -159,11 +163,11 @@
#
# Bin Scripts
#
# Cleanse and purge...
for file in rvm-prompt rvm rvmsudo rvm-shell rvm-auto-ruby ; do
- spinner && perl -e 'sleep 0.2'
+ spinner && sleep $sleep
\rm -f "$rvm_bin_path/$file"
\cp -f "$source_path/binscripts/$file" $rvm_bin_path/
done
spinner
chmod +x $rvm_bin_path/*
@@ -195,11 +199,11 @@
# Initial Interpreter Gemsets.
#
spinner
if [[ -d gemsets/ ]] ; then
\mkdir -p "$rvm_gemsets_path"
- for gemset_file in $(cd gemsets ; find . -iname '*.gems' | sed 's/^\.\///') ; do
+ for gemset_file in $(cd gemsets ; find \. -iname '*.gems' | sed 's/^\.\///') ; do
destination="$rvm_gemsets_path/$gemset_file"
destination_path="$(dirname "$destination")"
if [[ ! -s "$destination" ]] ; then
\mkdir -p "$destination_path"
\cp "gemsets/$gemset_file" "$destination"
@@ -208,11 +212,11 @@
fi
spinner
if [[ -d patchsets/ ]] ; then
\mkdir -p "$rvm_patchsets_path"
- for patchset_file in $(cd patchsets ; find . -iname '*' | sed 's/^\.\///') ; do
+ for patchset_file in $(cd patchsets ; find \. -iname '*' | sed 's/^\.\///') ; do
destination="$rvm_patchsets_path/$patchset_file"
destination_path="$(dirname "$destination")"
if [[ ! -s "$destination" ]] ; then
\mkdir -p "$destination_path"
\cp "patchsets/$patchset_file" "$destination"
@@ -304,10 +308,10 @@
printf "\n\n${name:-"$(whoami)"},\n"
printf "\nThank you for using rvm. I hope that it makes your work easier and more enjoyable."
printf "\nIf you have any questions, issues and/or ideas for improvement please hop in #rvm on irc.freenode.net and let me know."
printf "\nMy irc nickname is 'wayneeseguin' and I hang out from ~09:00-17:00EST and again from ~21:00EST-~00:00EST."
printf "\nIf I do not respond right away, please hang around after asking your question, I will respond as soon as I am back."
-printf "\nBe sure to get head often as rvm development happens fast, you can do this by typing 'rvm update --head'."
+printf "\nBe sure to get head often as rvm development happens fast, you can do this by running 'rvm update --head'."
printf "\n w$(tput setaf 2)⦿‿⦿$(tput sgr0)t!"
printf "\n ~ Wayne\n"
if [[ "$upgrade_flag" -eq 1 ]] ; then
printf "\n$(tput setaf 6)Upgrade Notes\n"