crosscode script: Accounts' pre-deploy dumps don't stop a deploy

The dump made before each Accounts deploy (apps/accounts/backend/backups/)
counted as a file added by hand on Accounts below 1.3.0, which has no
.gitignore for it, so the next deploy stopped. Untracked files in that
folder no longer count (CROSSCODE_OWN_DIRS in lib/common.sh).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-20 15:55:07 +02:00
co-authored by Claude Opus 5.5
parent ca55142f6f
commit e65e26202a
4 changed files with 43 additions and 5 deletions
+18 -4
View File
@@ -355,10 +355,24 @@ node_major() { node -p 'process.versions.node.split(".")[0]' 2>/dev/null || echo
# Files changed or added by hand in a checkout (ignored files such as .env, uploads, backups and
# the install's ecosystem.config.js never count). The PM2 configs this script makes for each
# install never count either, also in checkouts of releases that don't ignore them yet (Accounts
# 1.0–1.1 has no .gitignore for its ecosystem.config.cjs).
# 1.0–1.1 has no .gitignore for its ecosystem.config.cjs). Nor do the files in the folders this
# script writes into (Accounts below 1.3.0 doesn't ignore the database dumps made before each
# deploy, so the dump would stop the very deploy that brings the .gitignore).
CROSSCODE_OWN_FILES=(apps/events/ecosystem.config.js apps/accounts/ecosystem.config.cjs)
CROSSCODE_OWN_DIRS=(apps/accounts/backend/backups/)
local_changes() {
git_in "$1" status --porcelain --untracked-files=all | awk -v own="${CROSSCODE_OWN_FILES[*]}" '
BEGIN { n = split(own, f, " "); for (i = 1; i <= n; i++) skip[f[i]] = 1 }
!(substr($0, 1, 2) == "??" && substr($0, 4) in skip)'
git_in "$1" status --porcelain --untracked-files=all |
awk -v own="${CROSSCODE_OWN_FILES[*]}" -v dirs="${CROSSCODE_OWN_DIRS[*]}" '
BEGIN {
n = split(own, f, " "); for (i = 1; i <= n; i++) skip[f[i]] = 1
m = split(dirs, d, " ")
}
{
if (substr($0, 1, 2) == "??") {
path = substr($0, 4)
if (path in skip) next
for (i = 1; i <= m; i++) if (index(path, d[i]) == 1) next
}
print
}'
}