Исправление по замечанию: кэш сессий наполняется после промаха
Application / app (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
alenchha
2026-10-23 17:42:38 +03:00
parent a0c16afa33
commit 1a60b9cd1f
16 changed files with 263 additions and 194 deletions
+26 -1
View File
@@ -2,7 +2,32 @@
set -eu
cd "$(dirname "$0")/.."
[ -f .env ] || cp .env.example .env
if [ -f .env ]; then
added=$(python3 - <<'PYEOF'
def pairs(path):
result = []
for line in open(path, encoding="utf-8"):
stripped = line.strip()
if stripped and not stripped.startswith("#") and "=" in stripped:
result.append((stripped.split("=", 1)[0], line.rstrip("\n")))
return result
present = {name for name, _ in pairs(".env")}
missing = [line for name, line in pairs(".env.example") if name not in present]
if missing:
with open(".env", "a", encoding="utf-8") as handle:
handle.write("\n# Добавлено bootstrap из .env.example\n")
for line in missing:
handle.write(line + "\n")
print(" ".join(line.split("=", 1)[0] for line in missing))
PYEOF
)
if [ -n "$added" ]; then
echo "в .env добавлены отсутствующие переменные: $added"
fi
else
cp .env.example .env
fi
mkdir -p secrets
if [ ! -f secrets/postgres_password ]; then
python3 -c "import secrets; print(secrets.token_urlsafe(24))" > secrets/postgres_password