From a359371a481d5449727590cea69d665b22496890 Mon Sep 17 00:00:00 2001 From: Burrowdev Date: Sun, 18 Oct 2026 19:50:35 +0300 Subject: [PATCH] fix(deploy): restart after a push of many files update.sh piped git diff --name-only straight into grep -q; grep stops at the first match, so with a long list git hit a broken pipe and pipefail made the test false: "no restart needed" after 33f5607 (134 music files). The list is now taken whole, then searched. --- deploy/update.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/deploy/update.sh b/deploy/update.sh index a5c07d3..9ec74ca 100644 --- a/deploy/update.sh +++ b/deploy/update.sh @@ -27,8 +27,12 @@ for file in $(git diff --name-only "$old" "$new" -- '*.js'); do fi done -# public/ is read from disk on every request; the rest is loaded once, at start -if git diff --name-only "$old" "$new" | grep -qvE '^(public/|client-updates/|test/|tools/|deploy/|[^/]+\.md$|\.gitignore$)'; then +# public/ is read from disk on every request; the rest is loaded once, at start. +# the list is taken whole first: piped straight into grep -q, a long one (a +# push of many files) had git cut off mid-write ("Broken pipe"), which +# pipefail read as nothing to restart for. +changed=$(git diff --name-only "$old" "$new") +if grep -qvE '^(public/|client-updates/|test/|tools/|deploy/|[^/]+\.md$|\.gitignore$)' <<<"$changed"; then systemctl restart "$service" echo "updated $old -> $new, restarted $service" else