Files
mice-3ds/increment_version.sh
angel 285351e982
Some checks failed
Build (3DS) / build (push) Failing after 1m13s
YAY
2025-12-06 23:47:15 +00:00

19 lines
549 B
Bash
Executable File

#!/bin/bash
# Auto-increment development version number
VERSION_FILE="include/main.h"
CURRENT_VERSION=$(grep "MICE_VERSION" "$VERSION_FILE" | sed -n 's/.*"dev\([0-9]*\)".*/\1/p')
if [ -z "$CURRENT_VERSION" ]; then
echo "Could not find version number, starting at dev1"
NEW_VERSION=1
else
NEW_VERSION=$((CURRENT_VERSION + 1))
fi
echo "Incrementing version: dev$CURRENT_VERSION -> dev$NEW_VERSION"
# Update the version in the header file
sed -i "s/dev[0-9]*/dev$NEW_VERSION/g" "$VERSION_FILE"
echo "Version updated to dev$NEW_VERSION"