Add build archival script with timestamped snapshots (.gba, .elf, .map) (#420)

* added .sh script for copying output files under folder

* Update scripts/save_build.sh

Co-authored-by: Rickey <ric@rf3.xyz>

* Partial save functionality, comments & game name env variable

* indentation fixes

* exit with error val

Co-authored-by: Rickey <ric@rf3.xyz>

* make save_build.sh executable

---------

Co-authored-by: Rickey <ric@rf3.xyz>
This commit is contained in:
Umut Paklacı
2026-04-02 05:14:00 +03:00
committed by GitHub
parent 12ec71ba2c
commit 535601b514
3 changed files with 36 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
#!/usr/bin/env bash
# NOTE: This script is meant to be run from
# the root repository directory to work as intended.
set -e
make
GAME_NAME="${GAME_NAME-balatro-gba}"
timestamp=$(date +%Y%m%d_%H%M%S)
arg=${1:-"build"}
dir="saved_builds/${arg}_${timestamp}"
mkdir -p "$dir"
failed=0
for fe in elf gba map; do
if [ -f build/"$GAME_NAME".$fe ]; then
cp build/"$GAME_NAME".$fe "$dir/"
else
echo "Warning: build/$GAME_NAME.$fe not found"
failed=1
fi
done
if [ $failed -eq 1 ]; then
echo "Some files are missing, partially saved to $dir"
else
echo "Build files saved to $dir"
fi
exit $failed