Created
October 1, 2014 14:57
-
-
Save seancribbs/957e1c210b5ad9cd31c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Erlang switching | |
export PATH="$HOME/erlang/current/bin:$PATH" | |
# Detects the current erlang version | |
erlcur() { | |
DIR=`ls -lr $HOME/erlang | awk '/current/ { print $NF }'` | |
echo -n ${DIR##*/} | |
} | |
# Switches to the given erlang version using wildcards | |
erlsw() { | |
TARGET=`find $HOME/erlang -depth 1 -type d -name "*$1*" | head -1` | |
if [ -z "$TARGET" ]; then | |
echo "No release matching $1\!" | |
if [ -e $HOME/erlang/current ]; then | |
echo Using `erlcur` | |
fi | |
return | |
fi | |
ln -vnfs $TARGET $HOME/erlang/current | |
echo Using `erlcur` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment