From 137da9964475dca642f4153476b41d53954eafbc Mon Sep 17 00:00:00 2001 From: vasilito Date: Tue, 14 Jul 2026 11:53:39 +0900 Subject: [PATCH] scripts/bump-fork.sh: derive BRANCH_VERSION from git branch The script uses '${BRANCH_VERSION:-0.0.0}' as the +rb suffix when bumping a fork to a new upstream version. BRANCH_VERSION was never set, so any fork bump would have produced 'X.Y.Z+rb0.0.0' instead of the correct 'X.Y.Z+rb0.3.2' (or whichever branch is current). Derive BRANCH_VERSION from 'git branch --show-current' using the same pattern as local/scripts/build-redbear.sh:158-165. Falls back to '0.0.0' if the branch name doesn't match semver (e.g., on 'master'). (NO AI attribution) --- local/scripts/bump-fork.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/local/scripts/bump-fork.sh b/local/scripts/bump-fork.sh index cad9a9f554..4b9b2de576 100755 --- a/local/scripts/bump-fork.sh +++ b/local/scripts/bump-fork.sh @@ -11,6 +11,14 @@ set -euo pipefail +# Derive Red Bear OS version from the current git branch name. +# Branch "0.3.1" → BRANCH_VERSION="0.3.1". Same pattern as +# local/scripts/build-redbear.sh:158-165. Falls back to "0.0.0" if +# the branch name doesn't match semver. +BRANCH_VERSION=$(git -C "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" branch --show-current 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1 || true) +BRANCH_VERSION="${BRANCH_VERSION:-0.0.0}" +export BRANCH_VERSION + COMPONENT="${1:-}" if [[ -z "$COMPONENT" ]]; then echo "Usage: $0 [--version=X.Y.Z]"