Skip to content

Commit 0072371

Browse files
committed
Add usage instructions and confirmation prompt to releaseit script
1 parent 2963274 commit 0072371

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

bin/releaseit

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,20 @@
33
source <(pkgx dev --shellcode)
44
set -euo pipefail
55

6-
INCREMENT=${1:-PATCH}
6+
# Show usage if no argument provided
7+
if [ $# -eq 0 ]; then
8+
echo "Usage: releaseit <patch|minor|major>"
9+
echo ""
10+
echo "Create a new release by incrementing the version in .pkgx.yaml"
11+
echo ""
12+
echo "Arguments:"
13+
echo " patch - Increment patch version (x.y.Z)"
14+
echo " minor - Increment minor version (x.Y.0)"
15+
echo " major - Increment major version (X.0.0)"
16+
exit 1
17+
fi
18+
19+
INCREMENT=$1
720

821
increment_version() {
922
local version=$1
@@ -32,6 +45,22 @@ increment_version() {
3245

3346
current_version=$(yq e '.env.VERSION' .pkgx.yaml)
3447
new_version=$(increment_version "$current_version" "$INCREMENT")
48+
49+
# Show commits since last release
50+
echo "==> Commits since v$current_version:"
51+
echo ""
52+
git log --oneline "v$current_version..HEAD" 2>/dev/null || git log --oneline HEAD | head -10
53+
echo ""
54+
55+
# Ask for confirmation
56+
echo "Release v$current_version -> v$new_version"
57+
read -p "Continue with release? [y/N] " -n 1 -r
58+
echo
59+
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
60+
echo "Release cancelled."
61+
exit 0
62+
fi
63+
3564
yq e -i ".env.VERSION = \"$new_version\"" .pkgx.yaml
3665
git add .pkgx.yaml
3766
git commit -m "Release v$new_version"

0 commit comments

Comments
 (0)