sokko-g/scripts/backup-nebula-cards.mjs
Shinuwa 5ce35cd7ba Add the Sokko TCG collectible card mini-game
Add the server-backed card game: Discord login, recharging pack openings,
album, trades, gifts, stardust shop, campaign codes and its administration,
stored in SQLite and disabled in production until configured.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 17:47:35 +01:00

18 lines
996 B
JavaScript

// Rôle : sauvegarde ou vérifie la base Sokko TCG depuis les tâches d'exploitation.
import { resolve } from "node:path";
import { backupCardsDatabase, restoreCardsDatabase, verifyCardsDatabase } from "../services/cards/backup.js";
const [mode, source, destination] = process.argv.slice(2);
if (mode === "backup" && source && destination) {
await backupCardsDatabase(resolve(source), resolve(destination));
console.log(`Sokko TCG backup written to ${resolve(destination)}`);
} else if (mode === "verify" && source) {
verifyCardsDatabase(resolve(source));
console.log(`Sokko TCG backup verified: ${resolve(source)}`);
} else if (mode === "restore" && source && destination) {
restoreCardsDatabase(resolve(source), resolve(destination));
console.log(`Sokko TCG database restored to ${resolve(destination)}`);
} else {
console.error("Usage: node scripts/backup-nebula-cards.mjs backup <database> <backup> | verify <backup> | restore <backup> <database>");
process.exitCode = 1;
}