]> Untitled Git - git4ai.git/commitdiff
Script for daily repost update by cron. (In case hooks does not work or not configured)
authorNikolay Shaplov <dhyan@nataraj.su>
Sun, 7 Jun 2026 15:09:44 +0000 (15:09 +0000)
committerNikolay Shaplov <dhyan@nataraj.su>
Sun, 7 Jun 2026 15:09:44 +0000 (15:09 +0000)
scripts/update_all_repos.sh [new file with mode: 0755]

diff --git a/scripts/update_all_repos.sh b/scripts/update_all_repos.sh
new file mode 100755 (executable)
index 0000000..ce5fcd0
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+set -e
+
+source "${BASH_SOURCE%/*}"/config._sh
+
+if [ -z "$GIT_CLONE_PATH" ]; then
+    echo "GIT_CLONE_PATH is not set" >&2
+    exit 1
+fi
+
+if [ ! -d "$GIT_CLONE_PATH" ]; then
+    echo "Directory $GIT_CLONE_PATH does not exist" >&2
+    exit 1
+fi
+
+for repo in "$GIT_CLONE_PATH"/*/; do
+    [ -d "$repo" ] || continue
+    GIT_REPO=$(basename "$repo") \
+        "${BASH_SOURCE%/*}"/update_repo.sh
+done