1
0
mirror of https://github.com/juzzlin/Heimer.git synced 2025-05-09 21:01:39 +08:00
Heimer/scripts/update-version
2022-07-09 21:24:11 +03:00

30 lines
871 B
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# Updates Heimer version in all build and packaging scripts.
# Must be run in the project root.
VERSION_MAJOR=$1
VERSION_MINOR=$2
VERSION_PATCH=$3
if [[ ! $1 || ! $2 || ! $3 ]]; then
echo "Usage: $0 VERSION_MAJOR VERSION_MINOR VERSION_PATCH"
exit 1
fi
FILE=CMakeLists.txt
echo "Updating ${FILE} .."
sed -i "s/^set(VERSION_MAJOR.*/set(VERSION_MAJOR ${VERSION_MAJOR})/" ${FILE} || exit 1
sed -i "s/^set(VERSION_MINOR.*/set(VERSION_MINOR ${VERSION_MINOR})/" ${FILE} || exit 1
sed -i "s/^set(VERSION_PATCH.*/set(VERSION_PATCH ${VERSION_PATCH})/" ${FILE} || exit 1
for FILE in heimer.pro snapcraft.yaml scripts/build-app-image scripts/build-archive scripts/build-windows-zip; do
echo "Updating ${FILE} .."
sed -i -E "s/[0-9]+\.[0-9]+\.[0-9]+/$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH/g" ${FILE} || exit 1
done
git diff
echo "Done."