Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install Latest Julia Stable enviroment on Debian
#!/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
You can’t perform that action at this time.