Created
October 3, 2022 09:25
-
-
Save zothynine/c2029e05130fdca862fcabd1f5c8b5e2 to your computer and use it in GitHub Desktop.
Update the buildNumber in pdxinfo file of a Playdate project
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/sh | |
# Path to pdx info to be updated | |
FILE=./source/pdxinfo | |
# Path to folder for pdxinfo backup. Also add this folder to you .gitignore file | |
BAK=./tmp | |
echo "> Backing up pdxinfo\n" | |
cp $FILE $BAK | |
echo "> BACKED UP:" | |
cat $BAK/pdxinfo | |
echo "\n" | |
BUILD=$(cat $FILE | grep buildNumber | tr -dc '0-9') | |
echo "> CURRENT BUILD: $BUILD" | |
BUILD=$((BUILD+1)) | |
echo "> NEW BUILD: $BUILD" | |
echo "> WRITING NEW BUILD NUMBER: $BUILD" | |
# Make sure you already have a buildNumber=0 (or any number) in your pdxinfo | |
sed -i '' "s/buildNumber=[0-9]*/buildNumber=$BUILD/g" $FILE | |
echo "\n" | |
echo "> UPDATED pdxinfo:" | |
cat $FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment