From da6e625f872dc3fdae4a996bac28a1a8638d8911 Mon Sep 17 00:00:00 2001 From: joshashtondev Date: Sun, 20 Sep 2026 02:24:09 -0600 Subject: [PATCH] =?UTF-8?q?nixos:=20gen=2063=20@=20lilac=20=E2=80=94=20202?= =?UTF-8?q?6-09-20=2002:20=2026.05.20260918.cf9d2fb=20(Yarara)=20-----?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- home/jashton.nix | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/home/jashton.nix b/home/jashton.nix index 327ba08..b620813 100644 --- a/home/jashton.nix +++ b/home/jashton.nix @@ -91,16 +91,20 @@ in cd "$ROOT" mkdir -p bin - SOURCES="$1" - - find "$SOURCES" -name '*.java' -path '*.java' + # Set the target directory, defaulting to the current directory (.) if $1 is empty + TARGET_DIR="$1" + SOURCES_FILE="SOURCES" - if [ ! -s "$SOURCES" ]; then - echo "jbuild: no .java files found under ./$SOURCES" >&2 + # Fix the find command to safely search the target directory + find "$TARGET_DIR" -name '*.java' > "$SOURCES_FILE" + + if [ ! -s "$SOURCES_FILE" ]; then + # Fix the error message to reference the directory, not the output text file + echo "jbuild: no .java files found under $TARGET_DIR" >&2 exit 1 fi - javac -g --release 21 -encoding UTF-8 -d bin -cp "lib/*" @"$SOURCES" + javac -g --release 21 -encoding UTF-8 -d bin -cp "lib/*" @"$SOURCES_FILE" '') (pkgs.writeShellScriptBin "jclean" ''