#!/bin/bash
#
# Custom config for git_utils.

# Name of the project on GitHub (or any other online git tool).
GIT_REPO_FULL_NAME='cooperka/git-utils'

# Attempting to push to master will cause the scripts to abort unless this is set to `true`.
GIT_ALLOW_PUSH_TO_MASTER=false

# @param $1 version name to update to.
# @param $2 root directory of project.
perform_version_bump() {
  # Save the version number in a config file called 'example'.
  echo "$1" > "$2/example.cfg"

  # Commit the change.
  git add "${config_file}"
  git commit -m ":gem: Bump version to $1" -m "Auto-change using build script v${BUILD_SCRIPT_VERSION}."
}

#!/bin/bash
#
# Custom config for git_utils.

# Name of the project on GitHub (or any other online git tool).
GIT_REPO_FULL_NAME='cooperka/git-utils'

# Attempting to push to master will cause the scripts to abort unless this is set to `true`.
GIT_ALLOW_PUSH_TO_MASTER=false

# @param $1 version name to update to.
# @param $2 root directory of project.
perform_version_bump() {
  # Save the version number in an example config file...
  echo "$1" > "$2/example.cfg"

  # ...Or perhaps you'd like to edit an iOS Info.plist?
  local currVersion=defaults read "$2/Info.plist" 'CFBundleVersion'
  defaults write "$2/Info.plist" 'CFBundleVersion' -string "${currVersion}"
  defaults write "$2/Info.plist" 'CFBundleShortVersionString' -string "$1"

  # ...Or an Android Gradle config?
  gsed -r 's/(.*)(versionName )(.*)/echo "\1\2\\"$1\\""/ge' "$2/build.gradle"
  gsed -r 's/(.*)(versionCode )([0-9]+)(.*)/echo "\1\2$((\3+1))\4"/ge' "$2/build.gradle"

  # Commit the change.
  git add "$2/{example.cfg, Info.plist, build.gradle}"
  git commit -m ":gem: Bump version to $1" -m "Auto-change using build script v${BUILD_SCRIPT_VERSION}."
}

Add more detailed example to `perform_version_bump`
:pencil: Add more detailed example to `perform_version_bump`
