Skip to content

Instantly share code, notes, and snippets.

@zothynine
Created October 3, 2022 09:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zothynine/c2029e05130fdca862fcabd1f5c8b5e2 to your computer and use it in GitHub Desktop.
Save zothynine/c2029e05130fdca862fcabd1f5c8b5e2 to your computer and use it in GitHub Desktop.
Update the buildNumber in pdxinfo file of a Playdate project
#!/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