wobblyhead hg > minor_monsters
comparison tools/make_dist.sh @ 27:75deda08db90 0.9.1
game debug functions separated into own file; release build option, distribution script
| author | ark |
|---|---|
| date | 2026-10-20 17:19 +0200 |
| parents | |
| children | a464bd43b76c |
comparison
equal
deleted
inserted
replaced
| 26:28e1fc486be5 | 27:75deda08db90 |
|---|---|
| 1 #!/bin/sh | |
| 2 USAGE="$0 [--debug] | |
| 3 | |
| 4 build the game and pack www/ into dist/minor_monsters_<version>.tar.gz, | |
| 5 which unpacks into a directory minor_monsters. the version comes from | |
| 6 tools/get_version.sh -f: the latest tag, with a timestamp appended when | |
| 7 the working directory is not clean or not at the tagged revision. | |
| 8 | |
| 9 options: | |
| 10 -h, --help show this help | |
| 11 --debug build with the debug code and switches, not as a release | |
| 12 " | |
| 13 | |
| 14 DEBUG=0 | |
| 15 | |
| 16 while [ "$#" != 0 ] | |
| 17 do | |
| 18 case "$1" in | |
| 19 -h|--help) echo "$USAGE"; exit 0 ;; | |
| 20 --debug) DEBUG=1 ;; | |
| 21 *) | |
| 22 echo "unrecognized option '$1'" >&2 | |
| 23 exit 1 | |
| 24 ;; | |
| 25 esac | |
| 26 shift | |
| 27 done | |
| 28 | |
| 29 # build.py and get_version.sh work on the repository root | |
| 30 cd "$(dirname "$0")/.." && | |
| 31 if [ "$DEBUG" = 1 ] | |
| 32 then | |
| 33 python3 tools/build.py | |
| 34 else | |
| 35 python3 tools/build.py --release | |
| 36 fi && | |
| 37 VERSION=$(tools/get_version.sh -f) && | |
| 38 ARCHIVE="dist/minor_monsters_$VERSION.tar.gz" && | |
| 39 mkdir -p dist && | |
| 40 # www/ is stored as minor_monsters/ | |
| 41 tar --no-xattrs --no-mac-metadata --exclude .DS_Store -s ',^www,minor_monsters,' \ | |
| 42 -czf "$ARCHIVE" www && | |
| 43 echo "wrote $ARCHIVE" |
