From 228b2b159667b347340a700779469b3e4f580f0d Mon Sep 17 00:00:00 2001 From: julian Date: Sat, 16 Mar 2024 17:27:12 +0100 Subject: [PATCH] update compile.sh to work on macos (hopefully) --- compile.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compile.sh b/compile.sh index 27973653..dd744742 100755 --- a/compile.sh +++ b/compile.sh @@ -31,7 +31,7 @@ for file in "${JAVA_FILES[@]}"; do #substitute *.java -> *.class class_name="${class_name%.java}.class" #if .class file does not exists or .class file older than .java file - if [ ! -f "$class_name" ] || [ "$(stat -c "%Y" "$file")" -gt "$(stat -c "%Y" "$class_name")" ]; then + if [ ! -f "$class_name" ] || [ "$(find "$file" -prune -newer "$class_name")" ]; then JAVA_CHANGED+=("$file") JAVA_CLASSES+=("$class_name") fi @@ -44,7 +44,7 @@ for file in "${JAV_FILES[@]}"; do #substitute *.jav -> *.class class_name="${class_name%.jav}.class" #if .class file does not exists or .class file older than .jav file - if [ ! -f "$class_name" ] || [ "$(stat -c "%Y" "$file")" -gt "$(stat -c "%Y" "$class_name")" ]; then + if [ ! -f "$class_name" ] || [ "$(find "$file" -prune -newer "$class_name")" ]; then JAV_CHANGED+=("$file") JAV_CLASSES+=("$class_name") fi