Skip to content

Commit 9c53447

Browse files
committed
release: v0.8.6
1 parent 59be8be commit 9c53447

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mux",
3-
"version": "0.8.5",
3+
"version": "0.8.6",
44
"description": "mux - coder multiplexer",
55
"author": "Coder",
66
"main": "dist/cli/index.js",

scripts/bump_tag.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,23 @@ fi
2929

3030
echo "Bumping version: $CURRENT_VERSION -> $NEW_VERSION"
3131

32+
# Rollback function to restore original state on failure
33+
rollback() {
34+
echo "Error: Rolling back changes..." >&2
35+
jq --arg v "$CURRENT_VERSION" '.version = $v' package.json >package.json.tmp
36+
mv package.json.tmp package.json
37+
git reset HEAD -- package.json 2>/dev/null || true
38+
exit 1
39+
}
40+
3241
# Update package.json
3342
jq --arg v "$NEW_VERSION" '.version = $v' package.json >package.json.tmp
3443
mv package.json.tmp package.json
3544

36-
# Commit and tag
37-
git add package.json
38-
git commit -m "release: v${NEW_VERSION}"
39-
git tag "v${NEW_VERSION}"
45+
# Commit and tag (rollback on failure)
46+
git add package.json || rollback
47+
git commit -m "release: v${NEW_VERSION}" || rollback
48+
git tag "v${NEW_VERSION}" || rollback
4049

4150
echo "Created tag v${NEW_VERSION}"
4251
echo "Run 'git push && git push --tags' to publish"

0 commit comments

Comments
 (0)