@@ -111,19 +111,13 @@ BRANCH_PREFIX=$(echo "$GIT_USERNAME" | awk '{print $1}' | tr '[:upper:]' '[:lowe
111111
112112BRANCH_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 "
118116info " New version : $NEW_VERSION "
119117info " Target branch : $TARGET_BRANCH "
120118info " New branch : $BRANCH_NAME "
121119echo " "
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
129123read -rp " Proceed? [y/N] " confirm
@@ -144,6 +138,15 @@ git fetch origin "$TARGET_BRANCH"
144138info " Creating branch '$BRANCH_NAME ' from origin/$TARGET_BRANCH ..."
145139git 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
149152info " Updating src/version.ts..."
0 commit comments