Skip to content

Instantly share code, notes, and snippets.

@HendrikPetertje
Created September 13, 2016 11:50
Show Gist options
  • Save HendrikPetertje/521d19f5c50e8e6b8543ba51b7839ae9 to your computer and use it in GitHub Desktop.
Save HendrikPetertje/521d19f5c50e8e6b8543ba51b7839ae9 to your computer and use it in GitHub Desktop.
install elixir
#!/bin/sh
# Install script for elixir by Peter van der Meulen
echo "Welcome to elixir install script";
echo "Please make sure you currently have no installation of elixir on your computer before running this script \n";
echo "This script will install:";
echo "-erlang via homebrew";
echo "-exenv (an rbenv flavor for elixir)";
echo "-elixir build 1.3";
echo "\nwould you like to continue? (Y/N)"
read INSTALLANSWER
if [[ $INSTALLANSWER =~ ^[Yy]$ ]]; then
echo "Installing scripts";
else
echo "Not installing scripts";
exit 0;
fi
echo "Installing Erlang";
brew install erlang;
echo "----------------";
echo "Done";
if [ -d ~/.exenv ]; then
echo 'You already have exenv installed';
echo 'Attempting to update your exenv instead';
git -C ~/.exenv pull
else
echo "Cloning and installing exenv";
git clone git://github.com/mururu/exenv.git .exenv;
export PATH="$HOME/.exenv/bin:$PATH";
eval "$(exenv init -)";
fi
if [ -d ~/.exenv/versions/1.3.2/ ]; then
echo "you already have elixir 1.3.2 installed";
exit 1;
else
echo "downloading elixir 1.3";
curl -LOk "https://github.com/elixir-lang/elixir/archive/v1.3.2.zip";
echo "extracting elixir"
unzip v1.3.2.zip;
rm v1.3.2.zip;
mv elixir-1.3.2/ ~/.exenv/versions/1.3.2/;
echo "building elixir";
make -C ~/.exenv/versions/1.3.2;
echo "settting elixir";
exenv global 1.3.2;
fi
echo "--------";
echo "--------";
echo "# First time instructions (no need to if you already did this)"
echo "# please add the lines below to your shell profile file and restart your console";
echo 'export PATH="$HOME/.exenv/bin:$PATH"';
echo 'eval "$(exenv init -)"';
echo "";
echo "--------";
echo "installation complete press [enter] exit";
exit 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment