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" ''
set -euo pipefail
if [ $# -lt 1 ]; then
echo "usage: jbuild <package.MainClass> [args...]" >&2
exit 1
fi
ROOT="$(jroot)"
cd "$ROOT"
mkdir -p bin
# Set the target directory, defaulting to the current directory (.) if $1 is empty
TARGET_DIR="$1"
SOURCES_FILE="SOURCES"
# 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
# Fix the error message to reference the directory, not the output text file
@@ -119,30 +112,23 @@ in
(pkgs.writeShellScriptBin "jclean" ''
set -euo pipefail
ROOT="$(jroot)"
rm -rf "$ROOT/bin"
rm -rf "$ROOT/bin/*"
echo "cleaned $ROOT/bin"
'')
(pkgs.writeShellScriptBin "jrun" ''
set -euo pipefail
if [ $# -lt 3 ]; then
echo "usage: jrun <folder> <package> <MainClass> [args...]" >&2
echo "usage: jrun <package> <MainClass> [args...]" >&2
exit 1
fi
ROOT="$(jroot)"
cd "$ROOT"
jbuild "$1"
MAIN="$2.$3"
shift 3
shift 2
java -cp "bin:lib/*" "$MAIN" "$@"
'')
(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.
JUNIT="$(ls -1 "$HOME"/dev/jars/junit-platform-console-standalone-*.jar 2>/dev/null | sort -V | tail -n1 || true)"
if [ -z "$JUNIT" ]; then