Add build script with clean option

This commit is contained in:
Dandaedre 2026-09-19 01:21:54 +02:00
parent 2d33721655
commit 9a436f9456
Signed by: Dandaedre
GPG Key ID: 440C6592E8A26D99
3 changed files with 45 additions and 0 deletions

View File

@ -16,6 +16,17 @@ Les deux scripts Mod historiques sont conservés dans [`scripts/`](scripts/).
```sh
python -m venv .venv
.venv/bin/python -m pip install -r requirements.txt
./build.sh
./build.sh --clean
```
`build.sh` génère toutes les variantes et tous les thèmes sous
`RPG/d10_character_sheet/`. Avec `--clean`, il supprime d'abord ce dossier
ainsi que `build/`, puis reconstruit les fichiers publiables. Il utilise
`.venv/bin/python` si disponible, sinon `python3` avec les dépendances déjà
installées. Pour générer un thème isolé ou lister les thèmes :
```sh
.venv/bin/python tools/build.py --variant base --theme parchment
.venv/bin/python tools/build.py --variant cyberpunk --theme night
.venv/bin/python tools/build.py --list-themes

View File

@ -28,6 +28,7 @@
- [x] Prompt for the cyberpunk weapon dice count on each attack instead of storing a fixed value on the weapon.
- [x] Count cyberpunk ammo reserve as spare magazines and consume one per reload.
- [x] Add a Show chat card for cyberpunk consumables without changing their quantity.
- [x] Add a root build script for all publishable variants with an optional clean rebuild.
## Live Roll20 checks after local verification

33
build.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/sh
set -eu
root=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
cd "$root"
case "${1-}" in
'')
if [ "$#" -ne 0 ]; then
echo "Usage: ./build.sh [--clean]" >&2
exit 2
fi
;;
--clean)
if [ "$#" -ne 1 ]; then
echo "Usage: ./build.sh [--clean]" >&2
exit 2
fi
rm -rf -- "$root/build" "$root/RPG/d10_character_sheet"
;;
*)
echo "Usage: ./build.sh [--clean]" >&2
exit 2
;;
esac
if [ -x "$root/.venv/bin/python" ]; then
python="$root/.venv/bin/python"
else
python=python3
fi
"$python" tools/publish_builds.py