diff --git a/README.md b/README.md index 47dd5c2..b6da91c 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ sudo ./fullupgrade `makerelease.sh` automates a Git release workflow: -1. checks that the current branch is `dev` +1. checks that the current branch is `dev` for real releases 2. verifies the working tree is clean 3. optionally computes a new version from an increment shortcut 4. switches to `main` @@ -80,6 +80,7 @@ sudo ./fullupgrade - Make sure the `dev` branch contains the changes you want to release. - `VERSION` is used directly as the tag name. - If `VERSION` starts with `+`, it is treated as an increment based on the latest existing tag. +- `--dry-run` can be used from any branch and only prints the computed tag. - The script may fail if Git state is unexpected or if a tag already exists. - The tag message is automatically generated as `Release `. @@ -87,7 +88,7 @@ sudo ./fullupgrade This repository is intentionally minimal. - `fullupgrade` is hardened with `set -euo pipefail`. -- `makerelease.sh` now includes clean-tree checks, duplicate tag protection, increment shortcuts, dry-run support, and a trap to return to the original branch on exit. +- `makerelease.sh` now includes clean-tree checks, duplicate tag protection, increment shortcuts, dry-run support from any branch, and a trap to return to the original branch on exit. ## License diff --git a/makerelease.sh b/makerelease.sh index 7389810..18cabbb 100755 --- a/makerelease.sh +++ b/makerelease.sh @@ -33,7 +33,7 @@ Use --dry-run to show the computed release version without running Git actions. Requirements: - run from a clean Git working tree -- current branch must be dev +- current branch must be dev for real releases - main branch must exist locally EOF } @@ -74,7 +74,7 @@ fi CURRENTBRANCH=$(git rev-parse --abbrev-ref HEAD) ORIGBRANCH="${CURRENTBRANCH}" -if [ "${CURRENTBRANCH}" != "dev" ]; then +if [ "${is_dry_run}" = false ] && [ "${CURRENTBRANCH}" != "dev" ]; then echo "You are not in dev branch!" echo "Use dev branch to make a release!" exit 1