Skip to content

Instantly share code, notes, and snippets.

@kunthar
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kunthar/11379746 to your computer and use it in GitHub Desktop.
Save kunthar/11379746 to your computer and use it in GitHub Desktop.
run needed erlang version with kerl
# add this function to the .bashrc or .bash_profile
# change paths to your own paths. i recommend create a dedicated folder for otp versions
# Usage
#λ kunthar : erl_run
#checking installed versions in /Users/kunthar/development/erlang/kerl
#17.0 17.0-rc2 R15B01 R16B02 README.md bash_completion kerl* releases zsh_completion
#versions will be listed from the same directory!!!
#select one my friend
. /Users/kunthar/development/erlang/kerl/17.0/activate #change the activation path too
function erl_run()
{
echo "checking installed versions in /Users/kunthar/development/erlang/kerl"
echo `ls -l /Users/kunthar/development/erlang/kerl | awk '{print $9}' | cut -f1 -d'/'`
echo "select one my friend"
read input_variable
if [ -z "$input_variable" ]
then
echo "$(tput setaf 3) Release 17.0 selected as default"
echo $(tput sgr 0)
. /Users/kunthar/development/erlang/kerl/17.0/activate
erl
else
echo "$(tput setaf 2) Release $input_variable selected "
echo $(tput sgr 0)
. /Users/kunthar/development/erlang/kerl/$input_variable/activate
erl
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment