tags:

views:

27

answers:

0

I'm using OSX Snow Leopard with /etc/launchd.conf as my primary script to add environment variables. [The contents of this file are pasted below] So far this file works fine for my shell scripts and my applications. However, adding the last 3 RVM specific lines doesn't work for me. I can't access the rvm command. I have to do

$ source /etc/launchd.conf

to use all the settings in that file. My ~/.bashrc and ~/.bash_profile files do not exist. If I add the 3 RVM specific lines in ~/.bash_profile then my RVM works fine but other $PATH elements are lost, like git and magick.

# /etc/launchd.conf starts

export MAGICK_HOME="/usr/local/bin/ImageMagick-6.6.3"

export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$MAGICK_HOME/bin:/usr/local/git/bin:$PATH"

export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib"

source /usr/local/git/contrib/completion/git-completion.bash

GIT_PS1_SHOWDIRTYSTATE=true

export PS1='[\u@mbp \w$(__git_ps1)]\$ '

if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then source "$HOME/.rvm/scripts/rvm" ; fi

PS1="\$(~/.rvm/bin/rvm-prompt) $PS1"

if [[ -r $rvm_path/scripts/completion ]] ; then source $rvm_path/scripts/completion ; fi

# /etc/launchd.conf ends

any idea, how to avoid this mess in a small shell script (without sacrificing RVM)?