Files
balatro-gba-chinese-jocker-…/scripts/save_build.sh
T
Umut PaklacıandRickey 535601b514 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>
2026-04-01 19:14:00 -07:00

35 lines
672 B
Bash
Executable File

#!/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