Last active
May 13, 2017 01:23
-
-
Save moisespsena/4859e6fff854203d385f to your computer and use it in GitHub Desktop.
Install Latest Julia Stable enviroment on Debian
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 characters
#!/bin/bash | |
SD=$(dirname $(realpath "$0")) || exit 1 | |
[ `arch` = 'x86_64' ] && url='https://julialang.s3.amazonaws.com/bin/linux/x64/0.4/julia-0.4.2-linux-x86_64.tar.gz' \ | |
|| url='https://julialang.s3.amazonaws.com/bin/linux/x86/0.4/julia-0.4.2-linux-i686.tar.gz' | |
echo $url | |
tmpd="$SD/tmp" | |
[ ! -d "$tmpd" ] && mkdir -v "$tmpd" | |
file_name="$tmpd/"$(echo "$url" | perl -pe 's/^.+\/([^\/]+)$/\1/g') | |
wget -cv "$url" -O "$file_name" || exit 1 | |
dir_name=$(tar tzf "$file_name" | head -n 1) || exit 1 | |
JD="$SD/tmp/$dir_name" | |
WD=$(dirname "$SD") || exit 1 | |
if [ ! -d "$JD" ]; then | |
tar -zxvf "$file_name" -C "$SD/tmp" || exit 1 | |
fi | |
rm -fv "$WD/work" | |
ln -sv "$JD" "$WD/work" | |
"$WD/work/bin/julia" -e 'Pkg.add("Playground")' | |
if [ -f "$HOME/.bashrc" ]; then | |
grep 'JULIA_WORK' ~/.bashrc >/dev/null || echo 'export JULIA_WORK="'$WD'/work"; export PATH="$JULIA_WORK/bin:$HOME/.playground/bin:$PATH"' >> ~/.bashrc | |
echo PATH definido com sucesso em "~/.bashrc" | |
fi | |
echo | |
echo | |
echo Execute a linha abaixo para definir o PATH agora: | |
echo | |
echo export "PATH=\"$WD/work/bin:\$HOME/.playground/bin:\$PATH\"" | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment