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.
This commit is contained in:
Burrowdev committed 2026-10-18 19:50:35 +03:00
1 parent 33f56074a4
commit a359371a48
1 file changed
+6 -2
+6 -2
View File
@@ -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