Created
August 8, 2025 12:01
-
-
Save Abrifq/b04b6d164447941ba22c88e69419872a to your computer and use it in GitHub Desktop.
Used to check against https://github.com/tsoding/Murayact/pull/4
This file contains hidden or 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
| #!/bin/bash | |
| #The archive to be downloaded | |
| ARCHIVE_FILE_URL='https://github.com/raysan5/raylib/releases/download/5.5/raylib-5.5_win64_msvc16.zip' | |
| # Relative to archive root, the path of folder we are comparing. | |
| # If it's the root folder, leave it empty. ("") | |
| # Example: 'raylib_version_arch_buildsystem' will check '${ARCHIVE_EXTRACTION_FOLDER}/raylib_version_arch_buildsystem/' | |
| ARCHIVE_COMPARISON_STARTING_POINT='raylib-5.5_win64_msvc16' | |
| # Relative to pwd, the archive will be unarchived in here. | |
| ARCHIVE_EXTRACTION_FOLDER='a' | |
| # The git clone "link" to the pull request. | |
| PULL_REQUEST_URL='https://github.com/sakgoyal/Murayact.git' | |
| # The git branch to checkout | |
| PULL_REQUEST_BRANCH='windows' | |
| # Relative to repo root, the path of folder we are comparing. | |
| # If it's the root folder, leave it empty. | |
| # Example: 'vendor/raylib' will check '${PULL_REQUEST_FOLDER}/vendor/raylib/' | |
| PULL_REQUEST_COMPARISON_STARTING_POINT='packages/muray/vendor/raylib-5.5_win64_msvc16' | |
| # Relative to pwd, the pull request will be cloned to this path. | |
| PULL_REQUEST_FOLDER='b' | |
| ARCHIVE_FILE_NAME=`mktemp -p.` | |
| command -v wget | |
| if [ $? -eq 1 ] | |
| then | |
| echo "This script needs wget to download original archive file." | |
| echo "Please install wget and try again." | |
| exit 1; | |
| fi | |
| command -v git | |
| if [ $? -eq 1 ] | |
| then | |
| echo "This script needs git to clone the changes." | |
| echo "Please install git and try again." | |
| exit 2; | |
| fi | |
| command -v unzip | |
| if [ $? -eq 1 ] | |
| then | |
| echo "This script needs unzip to extract the archive." | |
| echo "Please install unzip and try again." | |
| exit 3; | |
| fi | |
| wget -nv --tries=3 ${ARCHIVE_FILE_URL} -O ${ARCHIVE_FILE_NAME} | |
| if [ $? -ne 0 ] | |
| then | |
| echo "Couldn't download the archive. Is the URL correct? Do you have internet? Can you access the archive link?" | |
| if [ -f ${ARCHIVE_FILE_NAME} ] | |
| then | |
| rm ${ARCHIVE_FILE_NAME} | |
| echo "Deleted partially downloaded archive file." | |
| fi | |
| exit 4; | |
| fi | |
| unzip -tq ${ARCHIVE_FILE_NAME} | |
| if [ $? -ne 0 ] | |
| then | |
| echo "The archive file seems to be corrupted. Try downloading again." | |
| rm ${ARCHIVE_FILE_NAME} | |
| echo "Deleted downloaded archive file." | |
| exit 5; | |
| fi | |
| mkdir -p ${ARCHIVE_EXTRACTION_FOLDER} ${PULL_REQUEST_FOLDER} | |
| unzip -q ${ARCHIVE_FILE_NAME} -d ${ARCHIVE_EXTRACTION_FOLDER} | |
| if [ $? -ne 0 ] | |
| then | |
| echo "Extraction failed for some reason. Maybe the disk is full or file-system is read only?" | |
| exit 6; | |
| fi | |
| git clone --single-branch --branch ${PULL_REQUEST_BRANCH} ${PULL_REQUEST_URL} ${PULL_REQUEST_FOLDER} | |
| if [ $? -ne 0 ] | |
| then | |
| echo "Something went wrong while cloning. Please fix the issue and try again." | |
| echo "Yes, I know that message is sooo helpful. What are you going to do, sue me?" | |
| exit 7; | |
| fi | |
| diff --recursive --brief --strip-trailing-cr --report-identical-files ${ARCHIVE_EXTRACTION_FOLDER}/${ARCHIVE_COMPARISON_STARTING_POINT} ${PULL_REQUEST_FOLDER}/${PULL_REQUEST_COMPARISON_STARTING_POINT} | |
| if [ $? -ne 0 ] | |
| then | |
| echo "the archive DIFFERS! PROCEED WITH CAUTION" | |
| exit 8; | |
| else | |
| echo "the archive matches with the repo. You can safely mark those as reviewed. Have a nice day! :)" | |
| exit 0; | |
| fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment