Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b6ZEVHGaYy15HAxRzy
18 lines
853 B
Bash
Executable File
18 lines
853 B
Bash
Executable File
#!/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"
|