diff --git a/README.md b/README.md index 19c7c63..5f03d94 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/TASKS.md b/TASKS.md index b8c2c48..fc535fd 100644 --- a/TASKS.md +++ b/TASKS.md @@ -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 diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..43a788d --- /dev/null +++ b/build.sh @@ -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