Skip to content

Commit 0ccbf8b

Browse files
committed
update
1 parent 6544d3f commit 0ccbf8b

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

scripts/version-bump.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,19 +111,13 @@ BRANCH_PREFIX=$(echo "$GIT_USERNAME" | awk '{print $1}' | tr '[:upper:]' '[:lowe
111111

112112
BRANCH_NAME="${BRANCH_PREFIX}/version-${NEW_VERSION}"
113113

114-
# ── Read current version ─────────────────────────────────────────────────────
114+
# ── Show plan ─────────────────────────────────────────────────────────────────
115115

116-
CURRENT_VERSION=$(grep -oP 'VERSION = "\K[^"]+' "$VERSION_TS")
117-
info "Current version : $CURRENT_VERSION"
118116
info "New version : $NEW_VERSION"
119117
info "Target branch : $TARGET_BRANCH"
120118
info "New branch : $BRANCH_NAME"
121119
echo ""
122120

123-
if [[ "$CURRENT_VERSION" == "$NEW_VERSION" ]]; then
124-
error "Current version is already $NEW_VERSION. Nothing to do."
125-
fi
126-
127121
# ── Confirm with user ────────────────────────────────────────────────────────
128122

129123
read -rp "Proceed? [y/N] " confirm
@@ -144,6 +138,15 @@ git fetch origin "$TARGET_BRANCH"
144138
info "Creating branch '$BRANCH_NAME' from origin/$TARGET_BRANCH..."
145139
git checkout -b "$BRANCH_NAME" "origin/$TARGET_BRANCH"
146140

141+
# ── Read current version (after checkout so we read from the target branch) ──
142+
143+
CURRENT_VERSION=$(grep -oP 'VERSION = "\K[^"]+' "$VERSION_TS")
144+
info "Current version : $CURRENT_VERSION"
145+
146+
if [[ "$CURRENT_VERSION" == "$NEW_VERSION" ]]; then
147+
error "Current version is already $NEW_VERSION. Nothing to do."
148+
fi
149+
147150
# ── Update version in all files ──────────────────────────────────────────────
148151

149152
info "Updating src/version.ts..."

0 commit comments

Comments
 (0)