diff --git a/scripts/bibliotheque/exporter-registre.mjs b/scripts/bibliotheque/exporter-registre.mjs index ef0a707..6d090cb 100644 --- a/scripts/bibliotheque/exporter-registre.mjs +++ b/scripts/bibliotheque/exporter-registre.mjs @@ -5,6 +5,7 @@ * Usage : * node scripts/bibliotheque/exporter-registre.mjs --registre --jeux \ * [--sortie data/bibliotheque/oeuvres-registre.json] + * Sans --registre : la variable AEP_REGISTRE (lot 13 bis, pour éprouver un registre candidat). * * Lit le registre du vault (lecture seule) et le dossier des jeux M6b (un `/__extraction.json` * par œuvre lue, pour joindre l'identifiant du registre au slug de la fiche) ; écrit un seul fichier, @@ -86,7 +87,7 @@ const principal = process.argv[1] && import.meta.url.endsWith(process.argv[1].sp if (principal) { const a = process.argv.slice(2) const arg = (k, d) => (a.includes(k) ? a[a.indexOf(k) + 1] : d) - const registre = arg('--registre') + const registre = arg('--registre', process.env.AEP_REGISTRE) // lot 13 bis : AEP_REGISTRE, si --registre manque const jeux = arg('--jeux') const sortie = arg('--sortie', 'data/bibliotheque/oeuvres-registre.json') if (!registre || !jeux) { diff --git a/scripts/bibliotheque/registre_lib.py b/scripts/bibliotheque/registre_lib.py index b283fa2..31b18db 100644 --- a/scripts/bibliotheque/registre_lib.py +++ b/scripts/bibliotheque/registre_lib.py @@ -15,7 +15,9 @@ appartient_a seulement). « À lire ensuite » s'appuie donc sur : le même aute """ import json, pathlib, os -REGISTRE = pathlib.Path(os.environ["REGISTRE"]) if os.environ.get("REGISTRE") else None +# lot 13 bis : AEP_REGISTRE (un registre candidat), puis REGISTRE ; --registre des scripts l'emporte (configurer) +_ENV_REG = os.environ.get("AEP_REGISTRE") or os.environ.get("REGISTRE") +REGISTRE = pathlib.Path(_ENV_REG) if _ENV_REG else None RECOUPEMENT = pathlib.Path(__file__).resolve().parents[2] / "data" / "bibliotheque" / "regime-recoupe.json" _REC = None DP, SD = "domaine public", "sous droits" diff --git a/scripts/test-bibliotheque.mjs b/scripts/test-bibliotheque.mjs index fc6cccc..0d1a45c 100644 --- a/scripts/test-bibliotheque.mjs +++ b/scripts/test-bibliotheque.mjs @@ -326,7 +326,8 @@ print(json.dumps({ } // R8 et déterminisme : deux rendus, zéro différence (lecture seule du registre et des jeux) - const REG = process.env.BIBLIOTHEQUE_REGISTRE ?? join(process.env.HOME ?? '', 'Dropbox', 'ATIS - IPCJRA', '1 PROJETS', 'DEV', 'AEP', 'RAG-Emancipation', 'registre.json') + // lot 13 bis : AEP_REGISTRE (registre candidat), sinon BIBLIOTHEQUE_REGISTRE, sinon le registre du vault (le défaut) + const REG = process.env.AEP_REGISTRE ?? process.env.BIBLIOTHEQUE_REGISTRE ?? join(process.env.HOME ?? '', 'Dropbox', 'ATIS - IPCJRA', '1 PROJETS', 'DEV', 'AEP', 'RAG-Emancipation', 'registre.json') const JEUX = process.env.BIBLIOTHEQUE_JEUX ?? join(process.env.HOME ?? '', 'rag', 'work', 'm6b', 'out') const src = lire('scripts', 'bibliotheque', 'rendre_socle.py') ok(/sys\.exit\(1\)|SystemExit\(1\)/.test(src) && /echecs/.test(src), 'R8 : rendre_socle.py sort en code non nul et nomme les œuvres en échec')