Skip to content

Instantly share code, notes, and snippets.

@smathy
Created February 21, 2010 07:27
Show Gist options
  • Save smathy/310185 to your computer and use it in GitHub Desktop.
Save smathy/310185 to your computer and use it in GitHub Desktop.
function r18 {
r_comb 1.8 "ruby rb-rubygems"
}
function r19 {
r_comb 1.9 ruby19
}
function r_comb {
for i in `port contents $2 | grep /bin/`
do
DIR=$(dirname $i)
FILE=$(basename ${i/[0-9]*/})
VFILE=${FILE}$1
pushd $DIR > /dev/null
if [ ! -L $FILE ]; then
sudo mv $FILE ${FILE}1.8
fi
sudo ln -snf $VFILE $FILE
popd > /dev/null
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment