nixos: gen 82 @ lilac — 2026-10-08 13:52 26.05.20260918.cf9d2fb (Yarara) -----

This commit is contained in:
2026-10-08 13:52:51 -06:00
parent a49564aae6
commit be8fefcb9c
+4 -18
View File
@@ -84,22 +84,15 @@ in
'') '')
(pkgs.writeShellScriptBin "jbuild" '' (pkgs.writeShellScriptBin "jbuild" ''
set -euo pipefail
if [ $# -lt 1 ]; then
echo "usage: jbuild <package.MainClass> [args...]" >&2
exit 1
fi
ROOT="$(jroot)" ROOT="$(jroot)"
cd "$ROOT" cd "$ROOT"
mkdir -p bin mkdir -p bin
# Set the target directory, defaulting to the current directory (.) if $1 is empty # Set the target directory, defaulting to the current directory (.) if $1 is empty
TARGET_DIR="$1"
SOURCES_FILE="SOURCES" SOURCES_FILE="SOURCES"
# Fix the find command to safely search the target directory # Fix the find command to safely search the target directory
find "$TARGET_DIR" -name '*.java' > "$SOURCES_FILE" find . -name '*.java' > "$SOURCES_FILE"
if [ ! -s "$SOURCES_FILE" ]; then if [ ! -s "$SOURCES_FILE" ]; then
# Fix the error message to reference the directory, not the output text file # Fix the error message to reference the directory, not the output text file
@@ -119,30 +112,23 @@ in
(pkgs.writeShellScriptBin "jclean" '' (pkgs.writeShellScriptBin "jclean" ''
set -euo pipefail set -euo pipefail
ROOT="$(jroot)" ROOT="$(jroot)"
rm -rf "$ROOT/bin" rm -rf "$ROOT/bin/*"
echo "cleaned $ROOT/bin" echo "cleaned $ROOT/bin"
'') '')
(pkgs.writeShellScriptBin "jrun" '' (pkgs.writeShellScriptBin "jrun" ''
set -euo pipefail
if [ $# -lt 3 ]; then if [ $# -lt 3 ]; then
echo "usage: jrun <folder> <package> <MainClass> [args...]" >&2 echo "usage: jrun <package> <MainClass> [args...]" >&2
exit 1 exit 1
fi fi
ROOT="$(jroot)" ROOT="$(jroot)"
cd "$ROOT" cd "$ROOT"
jbuild "$1"
MAIN="$2.$3" MAIN="$2.$3"
shift 3 shift 2
java -cp "bin:lib/*" "$MAIN" "$@" java -cp "bin:lib/*" "$MAIN" "$@"
'') '')
(pkgs.writeShellScriptBin "jtest" '' (pkgs.writeShellScriptBin "jtest" ''
if [ "$#" -neq 1 ]; then
echo "usage: jtest <package>"
exit 1
fi
# sort -V so 1.10.2 beats 1.9.0; plain tail -n1 sorts those the wrong way. # sort -V so 1.10.2 beats 1.9.0; plain tail -n1 sorts those the wrong way.
JUNIT="$(ls -1 "$HOME"/dev/jars/junit-platform-console-standalone-*.jar 2>/dev/null | sort -V | tail -n1 || true)" JUNIT="$(ls -1 "$HOME"/dev/jars/junit-platform-console-standalone-*.jar 2>/dev/null | sort -V | tail -n1 || true)"
if [ -z "$JUNIT" ]; then if [ -z "$JUNIT" ]; then