mirror of
https://github.com/mwisnowski/mtg_python_deckbuilder.git
synced 2025-12-16 23:50:12 +01:00
chore(release): v2.2.2 – seed default config files on startup; preserve defaults in image; bump versions in compose; update changelog
This commit is contained in:
parent
1988f98c5b
commit
a0a12baa9b
7 changed files with 69 additions and 30 deletions
|
|
@ -1,6 +1,28 @@
|
|||
#!/usr/bin/env sh
|
||||
set -e
|
||||
|
||||
# Seed default config files into /app/config if missing (handles first-run with mounted volume)
|
||||
seed_defaults() {
|
||||
# Ensure base config directory exists
|
||||
mkdir -p /app/config /app/config/card_lists
|
||||
|
||||
# Copy from baked-in defaults if targets are missing
|
||||
if [ -d "/.defaults/config" ]; then
|
||||
# deck.json
|
||||
[ -f /app/config/deck.json ] || cp "/.defaults/config/deck.json" "/app/config/deck.json" 2>/dev/null || true
|
||||
# combos.json and synergies.json
|
||||
[ -f /app/config/card_lists/combos.json ] || cp "/.defaults/config/card_lists/combos.json" "/app/config/card_lists/combos.json" 2>/dev/null || true
|
||||
[ -f /app/config/card_lists/synergies.json ] || cp "/.defaults/config/card_lists/synergies.json" "/app/config/card_lists/synergies.json" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# Back-compat: if someone expects combo.json, symlink to combos.json when present
|
||||
if [ ! -e /app/config/card_lists/combo.json ] && [ -f /app/config/card_lists/combos.json ]; then
|
||||
ln -s "combos.json" "/app/config/card_lists/combo.json" 2>/dev/null || true
|
||||
fi
|
||||
}
|
||||
|
||||
seed_defaults
|
||||
|
||||
# Always operate from the code directory for imports to work
|
||||
cd /app/code || exit 1
|
||||
|
||||
|
|
@ -8,8 +30,8 @@ cd /app/code || exit 1
|
|||
MODE="${APP_MODE:-web}"
|
||||
|
||||
if [ "$MODE" = "cli" ]; then
|
||||
# Run the CLI (interactive menu; use DECK_MODE=headless for non-interactive)
|
||||
exec python main.py
|
||||
# Run the CLI (interactive menu; use DECK_MODE=headless for non-interactive)
|
||||
exec python main.py
|
||||
fi
|
||||
|
||||
# Web UI (FastAPI via uvicorn)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue