Portable Julia

In case this applies to your situation: I use the git bash. Here is my bash script to set up the portable Julia:

#
set -o errexit 
set -o nounset

# Make sure we are in the folder in which the portable Julia is installed.
MyPortableJulia=julia-1.5.0
if [ ! -d $(pwd)/$MyPortableJulia ] ; then
    echo "Need to be in the folder with the portable Julia, $MyPortableJulia"
    exit 1
fi

# Locate the Julia depot in the current folder.
export MyDepot=$(pwd)/.$MyPortableJulia-depot
if [ ! -d $MyDepot ] ; then
    mkdir $MyDepot
fi
export JULIA_DEPOT_PATH=$MyDepot

# Make sure we can start Julia just by referring to the program name.
export PATH=$(pwd)/$MyPortableJulia/bin:$PATH

# Bring up the Julia prompt.
echo JULIA_DEPOT_PATH=$MyDepot
julia

A newer version, which starts VS code, looks like this:

#
set -o errexit 
set -o nounset

# Make sure we are in the folder in which the portable Julia is installed.
MyPortableJulia=julia-1.5.0
if [ ! -d $(pwd)/$MyPortableJulia ] ; then
    echo "Need to be in the folder with the portable Julia, $MyPortableJulia"
    exit 1
fi

# Locate the Julia depot in the current folder.
export MyDepot=$(pwd)/.$MyPortableJulia-depot
if [ ! -d $MyDepot ] ; then
    mkdir $MyDepot
fi
export JULIA_DEPOT_PATH=$MyDepot

# Make sure we can start Julia just by referring to the program name.
export PATH=$(pwd)/$MyPortableJulia/bin:$PATH

VSCode-win32-x64-1.48.1/Code

This file can be executed in Windows 10 just by double-clicking it.

2 Likes