run needed erlang version with kerl
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
# 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