This repository has been archived on 2024-12-15. You can view files and clone it, but cannot push or open issues or pull requests.
embedded-webview/tools/jenkins-increment-buildnumber.sh
2021-11-27 17:09:39 +01:00

12 lines
422 B
Bash
Executable File

#!/bin/bash
VERSION_AND_CODE="$(cat pubspec.yaml | grep 'version:' | sed 's/version: //')"
VERISON_NAME="$(echo $VERSION_AND_CODE | cut -d+ -f1)"
VERSION_CODE="$(echo $VERSION_AND_CODE | cut -d+ -f2)"
NEW_VERSION_CODE="$(( $VERSION_CODE + 1 ))"
sed -i "s/^version: .*$/version: ${VERISON_NAME}+${NEW_VERSION_CODE}/" pubspec.yaml
echo "Update pubspec for version ${VERISON_NAME}+${NEW_VERSION_CODE}"
exit $VERSION_CODE