Browse Source

Generalized jlpkg to work with base julia installations

balena
Micah Halter 5 months ago
parent
commit
c7ea1eec59
Signed by: mehalter GPG Key ID: 4224A6EA9A8CAAA8
1 changed files with 17 additions and 2 deletions
  1. +17
    -2
      zsh/.config/zsh/aliases

+ 17
- 2
zsh/.config/zsh/aliases View File

@ -123,6 +123,14 @@ jl() {
fi
}
jlp() {
if type jlpkg >/dev/null; then
jlpkg ${@}
else
$JULIA_DEPOT_PATH/bin/jlpkg-${1} ${@:2}
fi
}
## Activate a virtual environment by name (default="env")
jlactivate() {
[ ! -z "${VIRTUAL_ENV}" ] && deactivate
@ -148,13 +156,20 @@ jlenv() {
}
## Install basic packages in new Julia virtual environment
jlsetup() { jl ${@} -e 'using Pkg; Pkg.add(["PackageCompiler", "IJulia", "LanguageServer", "SymbolServer", "StaticLint", "Revise"]); Pkg.precompile()' && jlpkginstall && jlkernclean }
jlsetup() { jl ${@} -e 'using Pkg; Pkg.add(["PackageCompiler", "IJulia", "LanguageServer", "SymbolServer", "StaticLint", "Revise"]); Pkg.precompile()' && jlpkginstall ${1} && jlkernclean }
## Install jlpkg into virtual environments, don't use for base julia installs
jlpkginstall() {
if type julia >/dev/null; then
jl -e "using Pkg; Pkg.add(\"jlpkg\"); import jlpkg; jlpkg.install(destdir=\"${VIRTUAL_ENV}/bin\",force=true)"
ver=""
dest="${VIRTUAL_ENV}"
command="jlpkg"
else
ver="${1}"
dest="${JULIA_DEPOT_PATH}"
command="jlpkg-${ver}"
fi
jl ${ver} -e "using Pkg; Pkg.add(\"jlpkg\"); import jlpkg; jlpkg.install(destdir=\"${dest}/bin\",command=\"${command}\",force=true)"
}
## Create a new environment, activate it, and run the setup alias


Loading…
Cancel
Save