]> git.zue.dev - git.zue.dev/commitdiff
move html check to before docker checks
authorAlex Pooley (@zuedev) <zuedev@gmail.com>
Mon, 23 Mar 2026 10:56:29 +0000 (10:56 +0000)
committerAlex Pooley (@zuedev) <zuedev@gmail.com>
Mon, 23 Mar 2026 10:56:29 +0000 (10:56 +0000)
cron/minutely.bash

index 21a4045375c50a6462aa9eb15a4c9f7a4e86f1e7..6e696614a92b4106cb5e6d5698d8c760c75dc822 100644 (file)
@@ -15,6 +15,23 @@ fi
 # enter the repo
 cd "$GIT_ZUE_DEV" || { echo "Failed to change directory to $GIT_ZUE_DEV. PANIC!"; exit 1; }
 
+# array of files to check for changes
+HTML_FILES_TO_CHECK=(
+    "site_header.html"
+    "site_footer.html"
+    "home_text.html"
+)
+
+# loop through each file and check for changes
+for FILE in "${HTML_FILES_TO_CHECK[@]}"; do
+    if ! cmp -s "$DOCKER_COMPOSE_DIRECTORY/$FILE" <(git show HEAD:"html/$FILE"); then
+        echo "$FILE has changed. Updating local copy..."
+        git show HEAD:"html/$FILE" > "$DOCKER_COMPOSE_DIRECTORY/$FILE"
+    else
+        echo "$FILE has not changed. No action needed."
+    fi
+done
+
 # can we see the docker-compose.yaml file in the repo?
 git show HEAD:"$DOCKER_COMPOSE_FILENAME" > /dev/null 2>&1 || { echo "Failed to find $DOCKER_COMPOSE_FILENAME in the repository. PANIC!"; exit 1; }
 
@@ -34,24 +51,4 @@ else
     echo "$DOCKER_COMPOSE_FILENAME has not changed. No action needed."
 fi
 
-# return to the repo directory
-cd "$GIT_ZUE_DEV" || { echo "Failed to change directory to $GIT_ZUE_DEV. PANIC!"; exit 1; }
-
-# array of files to check for changes
-HTML_FILES_TO_CHECK=(
-    "site_header.html"
-    "site_footer.html"
-    "home_text.html"
-)
-
-# loop through each file and check for changes
-for FILE in "${HTML_FILES_TO_CHECK[@]}"; do
-    if ! cmp -s "$DOCKER_COMPOSE_DIRECTORY/$FILE" <(git show HEAD:"html/$FILE"); then
-        echo "$FILE has changed. Updating local copy..."
-        git show HEAD:"html/$FILE" > "$DOCKER_COMPOSE_DIRECTORY/$FILE"
-    else
-        echo "$FILE has not changed. No action needed."
-    fi
-done
-
 echo "Minutely cron job completed."
\ No newline at end of file
This page took 0.033493 seconds and 4 git commands to generate.