Skip to content

Commit

Permalink
Add a script to check baserom before building
Browse files Browse the repository at this point in the history
  • Loading branch information
laqieer committed Aug 23, 2024
1 parent 0dbeef9 commit 0e6eb34
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ If you find any new issue:

### Build

1. Put base ROM file named `baserom.gba` here
1. Put base ROM file named `baserom.gba` here and run `./check_baserom.sh`

1. Install [devkitPro](https://devkitpro.org/)

Expand Down
22 changes: 22 additions & 0 deletions check_baserom.sh
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

0 comments on commit 0e6eb34

Please sign in to comment.