]> git.zue.dev - git.zue.dev/commitdiff
use cmp for file comparison instead of git diff
authorAlex Pooley (@zuedev) <zuedev@gmail.com>
Mon, 23 Mar 2026 10:48:01 +0000 (10:48 +0000)
committerAlex Pooley (@zuedev) <zuedev@gmail.com>
Mon, 23 Mar 2026 10:48:01 +0000 (10:48 +0000)
cron/minutely.sh

index a0bd8db6aa5a958a2b3a4243128a86b333c674ed..ec67f72052b397c79e3759a10e6fd420dfc0898e 100644 (file)
@@ -19,7 +19,7 @@ cd "$GIT_ZUE_DEV" || { echo "Failed to change directory to $GIT_ZUE_DEV. PANIC!"
 git show HEAD:"$DOCKER_COMPOSE_FILENAME" > /dev/null 2>&1 || { echo "Failed to find $DOCKER_COMPOSE_FILENAME in the repository. PANIC!"; exit 1; }
 
 # compare our local copy of the docker-compose.yaml with the one in the repo
-if ! git diff --quiet HEAD:"$DOCKER_COMPOSE_FILENAME" "$DOCKER_COMPOSE_DIRECTORY/$DOCKER_COMPOSE_FILENAME"; then
+if ! cmp -s "$DOCKER_COMPOSE_DIRECTORY/$DOCKER_COMPOSE_FILENAME" <(git show HEAD:"$DOCKER_COMPOSE_FILENAME"); then
     echo "$DOCKER_COMPOSE_FILENAME has changed. Updating local copy..."
     git show HEAD:"$DOCKER_COMPOSE_FILENAME" > "$DOCKER_COMPOSE_DIRECTORY/$DOCKER_COMPOSE_FILENAME"
 
This page took 0.051491 seconds and 4 git commands to generate.