scripts/rvm-utility in wayneeseguin-rvm-0.0.46 vs scripts/rvm-utility in wayneeseguin-rvm-0.0.47

- old
+ new

@@ -52,15 +52,15 @@ } # Logging functions based on level function __rvm_log { case "$1" in - debug) shift ; echo -e "\033[0;35m<debug> \033[0m $* \033[0;35m</debug> \033[0m " ;; - info) shift ; echo -e "\033[0;32m<info> \033[0m $* \033[0;32m</info> \033[0m " ;; - warn) shift ; echo -e "\033[0;33m<warning> \033[0m $* \033[0;33m</warning> \033[0m " ;; - error) shift ; echo -e "\033[0;31m<error> \033[0m $* \033[0;31m</error> \033[0m " ;; - fail) shift ; echo -e "\033[0;31m<fail> \033[0m $* \033[0;31m</fail> \033[0m " ; __rvm_pushpop ; return 1 ;; + debug) shift ; echo -e "\033[0;35m<debug>\033[0m $* \033[0;35m</debug> \033[0m " ;; + info) shift ; echo -e "\033[0;32m<info>\033[0m $* \033[0;32m</info> \033[0m " ;; + warn) shift ; echo -e "\033[0;33m<warning>\033[0m $* \033[0;33m</warning> \033[0m " ;; + error) shift ; echo -e "\033[0;31m<error>\033[0m $* \033[0;31m</error> \033[0m " ;; + fail) shift ; echo -e "\033[0;31m<fail>\033[0m $* \033[0;31m</fail> \033[0m " ; __rvm_pushpop ; return 1 ;; *) echo -e "$*" esac } function __rvm_clean-path { @@ -84,11 +84,11 @@ touch $rvm_ruby_log_path/$log_file_name.log $rvm_ruby_log_path/$log_file_name.error.log # for zsh :( echo "[$(date +'%Y-%m-%d %H:%M:%S')] $command" | tee $rvm_ruby_log_path/$log_file_name.log > $rvm_ruby_log_path/$log_file_name.error.log if [ -z "$rvm_niceness" -o "$rvm_niceness" = "0" ] ; then eval "$command" >> $rvm_ruby_log_path/$log_file_name.log 2>> $rvm_ruby_log_path/$log_file_name.error.log else - eval "nice -n $rvm_niceness /bin/bash -l -c '$command'" >> $rvm_ruby_log_path/$log_file_name.log 2>> $rvm_ruby_log_path/$log_file_name.error.log + eval "nice -n $rvm_niceness \`$command\`" >> $rvm_ruby_log_path/$log_file_name.log 2>> $rvm_ruby_log_path/$log_file_name.error.log fi if [ $? -gt 0 ] ; then __rvm_log "error" "Error running '$command', please check $rvm_ruby_log_path/$log_file_name.error.log" ; __rvm_pushpop ; return 1 ; fi unset log_file command } @@ -100,13 +100,11 @@ function __rvm_load-rvmrc { if [ -s ~/.rvmrc ] ; then source ~/.rvmrc ; fi } function __rvm_bin_scripts { - # NOTE: This depends on the forthcoming ruby_string select functionality. - rvm_ruby_binaries=`/bin/ls $rvm_path/*/bin/ruby 2> /dev/null` - for rvm_ruby_binary in $rvm_ruby_binaries ; do + for rvm_ruby_binary in `/bin/ls $rvm_path/*/bin/ruby 2> /dev/null` ; do if [ -x $rvm_ruby_binary ] ; then rvm_ruby_string=`dirname $rvm_ruby_binary | xargs dirname | xargs basename` __rvm_select __rvm_bin_script fi @@ -342,35 +340,33 @@ echo -e "=> $version : $string" selected="1" else echo -e " $version : $string" fi - done - unset version + done ; unset version echo -e "\njruby:\n" for version in `/bin/ls -l $rvm_path/ 2> /dev/null | awk '/jruby-.*/ { print $NF }'` ; do string=`$rvm_bin_path/$version -v` if [ "$current" = "$version" ] ; then echo -e "=> $version : $string" selected="1" else echo -e " $version : $string" fi - done - unset version + done ; unset version echo -e "\nree:\n" for version in `/bin/ls $rvm_path/ 2> /dev/null | awk '/ruby-enterprise-.*/ { print $NF }'` ; do string=`$rvm_bin_path/$version -v | tr "\n" ' ' ` if [ "$current" = "$version" ] ; then echo -e "=> $version : $string" selected="1" else echo -e " $version : $string" fi - done + done ; unset version if [ -f $rvm_path/default -a -s $rvm_path/default ] ; then version=`grep '^MY_RUBY_HOME' ~/.rvm/default | awk -F"'" '{print $2}' | xargs basename` if [ ! -z "$version" ] ; then echo -e "\ndefault:\n" @@ -379,29 +375,26 @@ echo -e "=> $version : $string" selected="1" else echo -e " $version : $string" fi - fi + fi ; unset version fi echo -e "\nsystem:\n" - system_version=`bash -l -c 'rvm system ; ruby -v 2> /dev/null'` + system_version=`rvm system ; ruby -v 2> /dev/null` if [ ! -z "$system_version" ] ; then if [ "$selected" = "1" ] ; then echo -e " $system_version\n" else echo -e "=> $system_version\n" fi - fi - unset current version selected + fi ; unset current version selected fi - } function __rvm_initialize { - rvm_fetch=`which curl` if [ $? -ne 0 ] ; then rvm_fetch=`which wget` if [ $? -ne 0 ] ; then __rvm_log "fail" "rvm expects either curl or wget, neither seem to be in your path :(" @@ -520,11 +513,11 @@ rvm_command="$rvm_ruby_home/bin/$binary $rvm_ruby_require -I$load_path -S $rvm_ruby_args" else rvm_command="$rvm_ruby_home/bin/$binary $rvm_ruby_args" fi echo -e "\n$rvm_ruby_string: $($rvm_ruby_home/bin/$binary -v)" - eval $rvm_command + eval "$rvm_command" result=$? if [ $result -eq 0 ]; then eval "successes=(${successes[*]} $rvm_ruby_string)" else eval "errors=(${errors[*]} $rvm_ruby_string)" @@ -548,10 +541,13 @@ elif [ ! -z "$rvm_ruby_version" ] ;then for rvm_ruby_selector in `echo $rvm_ruby_version | tr ',' ' '` ; do unset rvm_ruby_string __rvm_ruby_do done + elif [ ! -z "$rvm_ruby_interpreter" ] ; then + unset rvm_ruby_string rvm_ruby_version + __rvm_ruby_do else # all while read bin_line do # Keep this on second line damnit! if [ -x $bin_line ] ; then rvm_ruby_string="`dirname $bin_line | xargs dirname | xargs basename`" @@ -664,12 +660,10 @@ else unset rvm_ruby_patch_level rvm_ruby_rev fi fi fi - - if [ "rvm_ruby_interpreter" = "ree" ] ; then rvm_ruby_interpreter="ruby-enterprise" ; fi fi return 0 } function __rvm_gemset_dump { @@ -811,5 +805,6 @@ __rvm_run "$package.configure" ./configure --prefix=$rvm_path/usr --disable-shared __rvm_run "$package.make" make __rvm_run "$package.make.install" make install __rvm_pushpop } +