Add jbang: single-file Java with JBang 0.132.1 on JDK 25 (deps, compact source files, Spring Boot, templates, native)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b6ZEVHGaYy15HAxRzy
This commit is contained in:
Ankur Mhatre
2026-12-01 08:20:46 +05:30
co-authored by Claude Sonnet 5.5
parent 7c677a39d2
commit ddc3ec9d90
34 changed files with 639 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# Runs a script straight from a URL: first untrusted (JBang refuses), then after `jbang trust add`.
# Uses its own empty JBANG_DIR so the trust list starts empty.
cd "$(dirname "$0")/.."
export JAVA_HOME="${JAVA25:-/tmp/tools/jdk-25.0.5.1+2}" PATH="${JAVA25:-/tmp/tools/jdk-25.0.5.1+2}/bin:$PATH"
export JBANG_DIR="$(mktemp -d)"
J="$PWD/scripts/jb.sh"
U=https://ankurm.com/wp-content/uploads/2026/12/Hello.java
step() { printf '$ %s\n' "$*"; }
step jbang $U Remote
timeout 100 $J $U Remote < /dev/null 2>&1; echo "[exit status: $?]"
echo; step jbang trust add https://ankurm.com/wp-content/uploads/
$J trust add https://ankurm.com/wp-content/uploads/ 2>&1
echo; step jbang $U Remote
timeout 100 $J $U Remote < /dev/null 2>&1
echo; step "grep -v '^//' \$JBANG_DIR/trusted-sources.json"
grep -v '^//' "$JBANG_DIR/trusted-sources.json"