Skip to content

Instantly share code, notes, and snippets.

@tanitanin
Created February 14, 2015 17:03
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 tanitanin/b6dec25b5bbc777d4910 to your computer and use it in GitHub Desktop.
Save tanitanin/b6dec25b5bbc777d4910 to your computer and use it in GitHub Desktop.
Install script for scala version manager
#!/usr/bin/env bash
do_svm_install() {
svm_path=$HOME/.svm
if [[ ! -d "$svm_path" ]]; then
echo "Making directory $svm_path"
mkdir -p $svm_path
fi
if [[ ! -e "$svm_path/bin/.git" ]]; then
echo "Get svm from github.com/yuroyoro/svm.git"
git clone https://github.com/yuroyoro/svm $svm_path/bin
fi
}
set_svm_path_to_bashrc() {
echo "Adding PATH to .bashrc"
echo "
# For scala version manager
export PATH=\$HOME/.svm/bin:\$PATH
if [[ -d \"\$HOME/.svm/current/rt\" ]]; then
export SCALA_HOME=\$HOME/.svm/current/rt
export PATH=\$SCALA_HOME/bin:\$PATH
fi" >> $HOME/.bashrc
}
do_svm_install
set_svm_path_to_bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment