joltc grew from a single -e expression into a real project runner. require now loads a namespace's .clj/.cljc from the source roots transitively (load-once), so a multi-file project works; the corpus/unit gates load compile-eval.ss but not the loader, so their alias-only require is unchanged. jolt.deps resolves a deps.edn into ordered source roots — git + local deps only (no Maven), breadth-first so a top-level pin wins, with aliases (:extra-paths/ :extra-deps/:main-opts) and tasks. Git deps clone into a sha-immutable cache ($JOLT_GITLIBS, else ~/.jolt/gitlibs) by shelling out to git via a new jolt.host/sh primitive. jolt.main dispatches run -m / -M:alias / -A / repl / path / a deps.edn task. The launcher passes the user's cwd as JOLT_PWD (the project dir) since it cd's to the repo root for the runtime's relative loads.
19 lines
823 B
Bash
Executable file
19 lines
823 B
Bash
Executable file
#!/bin/sh
|
|
# joltc — the pure-Chez jolt runtime. NO Janet.
|
|
#
|
|
# Compiles and evaluates jolt (Clojure) on Chez using the checked-in bootstrap
|
|
# seed (host/chez/seed/). With only Chez installed it runs jolt end to end:
|
|
#
|
|
# joltc -e "(+ 1 2)" evaluate an expression
|
|
# joltc run -m app.core [args] resolve deps.edn, run a namespace's -main
|
|
# joltc -M:alias [args] run an alias's :main-opts
|
|
# joltc repl | path | <task> REPL, print roots, or a deps.edn task
|
|
#
|
|
# The launcher cd's to the jolt repo root so the runtime's relative loads work;
|
|
# the user's original cwd (the project dir, where deps.edn lives) is passed in
|
|
# JOLT_PWD.
|
|
root="$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)"
|
|
JOLT_PWD="${JOLT_PWD:-$PWD}"
|
|
export JOLT_PWD
|
|
cd "$root" || exit 1
|
|
exec chez --script host/chez/cli.ss "$@"
|