Skip to content

Instantly share code, notes, and snippets.

@victorbnl
Last active January 17, 2021 18:28
Show Gist options
  • Save victorbnl/cffc1a1b9e646faa5c790268ab3cf174 to your computer and use it in GitHub Desktop.
Save victorbnl/cffc1a1b9e646faa5c790268ab3cf174 to your computer and use it in GitHub Desktop.
Pre-commit hook to increase build.gradle version
#!/bin/sh
# Increment versionCode
perl -pi -e 's/versionCode ([0-9]+)/"versionCode " . ($1+1)/e' ./app/build.gradle
# Increment versionName
perl -pi -e 's/versionName \"([0-9]+)\"/"versionName \"" . ($1+1) . "\""/e' ./app/build.gradle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment