Przeglądaj źródła

Fix check-git-repo-updates in scripts

poesty 1 rok temu
rodzic
commit
ab1af250f6
2 zmienionych plików z 2 dodań i 2 usunięć
  1. 1 1
      update/update_bookstack.sh
  2. 1 1
      update/update_librex.sh

+ 1 - 1
update/update_bookstack.sh

@@ -16,7 +16,7 @@ cd $BOOKSTACK_DIR || exit
 
 # Check update
 git fetch origin release -n --quiet
-[ -n "$(git diff --quiet @ @{u})" ] || { echo "Up-to-date" && exit; }
+git diff --quiet HEAD FETCH_HEAD && echo "Up-to-date" && exit
 
 # Get database options from BookStack .env file
 export $(cat "$BOOKSTACK_DIR/.env" | grep ^DB_ | xargs)

+ 1 - 1
update/update_librex.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 cd /root/librex
 git fetch origin main -n --quiet
-[ -n "$(git diff --quiet @ @{u})" ] || { echo "Up-to-date" && exit; }
+git diff --quiet HEAD FETCH_HEAD && echo "Up-to-date" && exit
 git pull --quiet
 lftp -c "set sftp:auto-confirm yes; open sftp://[REDACTED]; mirror -Rev ./ [REMOTE]/ --only-newer --parallel=10 -X .htaccess -X config.php -X opensearch.xml -X robots.txt"