fix: --dry-run in release script
This commit is contained in:
1 file changed
+14
-6
+14
-6
@@ -11,12 +11,20 @@
|
|||||||
# listed under the release that follows.
|
# listed under the release that follows.
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
dry=false
|
usage="usage: $0 [--dry-run] <patch|minor|major, or a tag like v0.2.0>"
|
||||||
if [ "${1:-}" = "--dry-run" ]; then
|
# Options anywhere: minor --dry-run must not release.
|
||||||
dry=true
|
dry=false tag=""
|
||||||
shift
|
for arg in "$@"; do
|
||||||
fi
|
case "$arg" in
|
||||||
tag="${1:?usage: $0 [--dry-run] <patch|minor|major, or a tag like v0.2.0>}"
|
--dry-run | -n) dry=true ;;
|
||||||
|
-*) echo "$arg: unknown option. $usage" >&2; exit 1 ;;
|
||||||
|
*)
|
||||||
|
[ -z "$tag" ] || { echo "$arg: one version only. $usage" >&2; exit 1; }
|
||||||
|
tag=$arg
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
[ -n "$tag" ] || { echo "$usage" >&2; exit 1; }
|
||||||
command -v git-cliff >/dev/null || { echo "git-cliff is needed: brew install git-cliff" >&2; exit 1; }
|
command -v git-cliff >/dev/null || { echo "git-cliff is needed: brew install git-cliff" >&2; exit 1; }
|
||||||
|
|
||||||
cd "$(dirname "$0")/.."
|
cd "$(dirname "$0")/.."
|
||||||
|
|||||||
Reference in new issue
Block a user