#!/bin/bash -eu

if [[ $(basename $(pwd)) == "bin" ]]; then
    cd ..
fi

export JULIA_PKG_SERVER_REGISTRY_PREFERENCE=eager

if [[ $# -gt 0 ]]; then
    JULIA_ARGS=("$@")
else
    JULIA_ARGS=(-i -e 'using VortexStepMethod; function menu(); include("examples/menu.jl"); end; function menu_cp(); include("examples_cp/menu_cp.jl"); end')
fi

julia --project "${JULIA_ARGS[@]}"
