From ef257d0a7d72840ef05ac45cf58de80d1d32ab21 Mon Sep 17 00:00:00 2001 From: laqieer Date: Fri, 23 Aug 2024 15:57:54 +0800 Subject: [PATCH] Add a script to check baserom before building --- check_baserom.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 check_baserom.sh diff --git a/check_baserom.sh b/check_baserom.sh new file mode 100755 index 00000000..6565f7c3 --- /dev/null +++ b/check_baserom.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# Check if the baserom.gba file exists +if [ ! -f baserom.gba ]; then + echo "baserom.gba not found!" + exit 1 +fi + +# Define the expected SHA-1 value +expected_sha1="A57095DA867DE4D585C33D4394712986245FE6CA" + +# Calculate the SHA-1 of the file (use shasum because sha1sum is not available on macOS) +actual_sha1=$(shasum baserom.gba | awk '{print $1}') + +# Compare the calculated SHA-1 with the expected value +if [ "${actual_sha1,,}" = "${expected_sha1,,}" ]; then + echo "SHA-1 matches!" + exit 0 +else + echo "SHA-1 does not match!" + exit 2 +fi