From d69e769ed0ab501bae699ff9964b2ca10e95395a Mon Sep 17 00:00:00 2001 From: Leons Aleksandrovs Date: Tue, 16 Dec 2025 15:13:32 +0200 Subject: [PATCH] Do not allow local remote sync while remote local is in progress --- scripts/local-remote.sh | 7 +++++++ scripts/remote-local.sh | 6 ++++++ scripts/watch-build.sh | 6 ++++++ 3 files changed, 19 insertions(+) diff --git a/scripts/local-remote.sh b/scripts/local-remote.sh index 54e612b..98efdbc 100644 --- a/scripts/local-remote.sh +++ b/scripts/local-remote.sh @@ -1,3 +1,10 @@ +REMOTE_PROGRESS=".remote-in-progress" + +if [ -f $REMOTE_PROGRESS ]; then + echo "Waiting for remote-local.sh to finish..." + exit 0 +fi + sshpass -p "${SERVER_PASSWORD}" \ rsync -avzu --delete \ `# Version control and editor files` \ diff --git a/scripts/remote-local.sh b/scripts/remote-local.sh index 0883390..19665cb 100644 --- a/scripts/remote-local.sh +++ b/scripts/remote-local.sh @@ -1,3 +1,7 @@ +REMOTE_PROGRESS=".remote-in-progress" + +touch $REMOTE_PROGRESS + sshpass -p "${SERVER_PASSWORD}" \ rsync -avzu \ `# Version control and editor files` \ @@ -26,3 +30,5 @@ sshpass -p "${SERVER_PASSWORD}" \ --exclude split-conflicts.sh \ -e ssh "${SERVER_USER}@${SERVER_HOST}:${SERVER_PATH}" . \ $1 + +rm $REMOTE_PROGRESS diff --git a/scripts/watch-build.sh b/scripts/watch-build.sh index 174c468..79d0c39 100644 --- a/scripts/watch-build.sh +++ b/scripts/watch-build.sh @@ -1,6 +1,7 @@ #!/bin/bash CACHE_FILE=".build-cache" +REMOTE_PROGRESS=".remote-in-progress" needs_build() { # If cache file doesn't exist, require build @@ -45,6 +46,11 @@ upload() { } if [ "$1" = "--upload" ]; then + if [ -f $REMOTE_PROGRESS ]; then + echo "Waiting for remote-local.sh to finish..." + exit 0 + fi + upload exit 0 fi