summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis Burda <contact@sinitax.com>2025-06-17 10:55:20 +0200
committerLouis Burda <contact@sinitax.com>2025-06-17 10:55:20 +0200
commitc1a56185a17ecc8b88ea163e45f47ce9f3bb09f3 (patch)
treee4397681e07cfa6beaf801b6ec877d582928f6dc
parent2e110a3885f1f197e3f918c41652a5df18a7976d (diff)
downloadgit-sync-c1a56185a17ecc8b88ea163e45f47ce9f3bb09f3.tar.gz
git-sync-c1a56185a17ecc8b88ea163e45f47ce9f3bb09f3.zip
Add timeout if repo is missing
-rwxr-xr-xgit-syncd6
1 files changed, 6 insertions, 0 deletions
diff --git a/git-syncd b/git-syncd
index 53fbf9c..51b14c8 100755
--- a/git-syncd
+++ b/git-syncd
@@ -32,6 +32,12 @@ watcher() {
sync "$repo"
timeout=$sync_timeout
while true; do
+ if [ ! -e "$repo" ]; then
+ echo "Repo does not exist"
+ echo "sleeping (${timeout}s)"
+ sleep $timeout
+ continue
+ fi
echo "watching (${timeout}s)"
file=$(timeout "$timeout" wd "$repo" inotifywait "." -r \
-e modify,move,create,delete --exclude "$exclude" 2>/dev/null)