wayneeseguin/rvm — pull request #2150 by mpapis (2013-08-20 20:30:20+00:00)
Title: sourcing $RVM_PATH/scripts/rvm sets wrong environment variable for rvm_bin_path and rvm_prefix

$ pwd
/home/rockj/nav-mirror-netmap/tools
$ source .rvm/scripts/rvm
$ env | grep rvm
rvm_bin_path=.rvm/bin
GEM_HOME=/home/rockj/nav-mirror-netmap/tools/.rvm/gems/ruby-1.9.2-p320
IRBRC=/home/rockj/nav-mirror-netmap/tools/.rvm/rubies/ruby-1.9.2-p320/.irbrc
MY_RUBY_HOME=/home/rockj/nav-mirror-netmap/tools/.rvm/rubies/ruby-1.9.2-p320
rvm_path=/home/rockj/nav-mirror-netmap/tools/.rvm
rvm_prefix=.
PATH=.rvm/bin:/home/rockj/nav-mirror-netmap/tools/.rvm/gems/ruby-1.9.2-p320/bin:/home/rockj/nav-mirror-netmap/tools/.rvm/gems/ruby-1.9.
2-p320@global/bin:/home/rockj/nav-mirror-netmap/tools/.rvm/rubies/ruby-1.9.2-p320/bin:/home/rockj/nav-mirror-netmap/tools/.rvm/bin:/usr
/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
rvm_env_string=ruby-1.9.2-p320
rvm_version=1.22.2 (/bugfix/github_issue_2149)
rvm_ruby_string=ruby-1.9.2-p320
GEM_PATH=/home/rockj/nav-mirror-netmap/tools/.rvm/gems/ruby-1.9.2-p320:/home/rockj/nav-mirror-netmap/tools/.rvm/gems/ruby-1.9.2-p320@gl
obal

I expect environment variables to use full path as relative paths will easily go wrong.

propose for fix ie:

$( cd $(dirname $0) ; pwd -P )