_setup_julia(){
if [ "$(uname -s)" != 'Darwin' ]; then
echo 'julia setup function works only on macOS';
return 2;
fi;
JULIA_APP="$(command ls /Applications | grep -i julia | sort -r | head -1)";
if [ ! "${JULIA_APP}" ]; then
echo "Julia is not installed";
return 1;
fi;
JULIA_PATH="/Applications/${JULIA_APP}/Contents/Resources/julia/bin";
export PATH=$PATH:$JULIA_PATH;
unset JULIA_APP JULIA_PATH;
}
_setup_julia
unset _setup_julia
之後開一個新的 Terminal �起來,直接執行 julia,
應該就可以看到最新版的 julia console
请发表评论