-
-
Save tmlbl/430f7d54cda16a43bff6 to your computer and use it in GitHub Desktop.
Revisions
-
tmlbl revised this gist
Jun 21, 2015 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,8 @@ # I keep Julia binaries in /opt/julia with the same directory structure # as ~/.julia to store different versions, and use this script to switch # between them. I also like to maintain a link of the ~/.julia folder to # ~/julia, for easier package development. JBIN="" PDIR="" -
tmlbl created this gist
Jun 21, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,40 @@ #!/bin/bash # I keep Julia binaries in /opt/julia with the same directory structure # as ~/.julia to store different versions, and use this script to switch # between them. JBIN="" PDIR="" if [[ ! "$1" ]]; then echo "Please specify a version, i.e." echo "$ jvm 0.4" exit 1 fi # Look for the package directory if [[ -d "$HOME/.julia/$1" ]]; then PDIR="$HOME/.julia/$1" elif [[ -d "$HOME/.julia/v$1" ]]; then PDIR="$HOME/.julia/v$1" else echo "No Julia packages for version $1 found." exit 1 fi # Look for the executable if [[ -d "/opt/julia/$1" ]]; then JBIN="/opt/julia/$1/bin/julia" elif [[ -d "/opt/julia/v$1" ]]; then JBIN="/opt/julia/v$1/bin/julia" else echo "Didn't find the executable in /opt/julia/<version>" exit 1 fi echo "Linking executable for version $1..." sudo rm /usr/bin/julia sudo ln -s $JBIN /usr/bin/julia echo "Linking packages shortcut for version $1..." rm -r ~/julia; ln -s $PDIR ~/julia