-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a script to check baserom before building
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |