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]"