From 0dcfeba90db556c1baf647c259952109a4408e95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Orhun=20Parmaks=C4=B1z?= Date: Fri, 15 Apr 2022 11:16:33 +0300 Subject: [PATCH] feat(release): allow empty changelog while releasing --- scripts/release.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/release.sh b/scripts/release.sh index f6361f3..e3dd583 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -14,11 +14,11 @@ usage() { printf "usage: %s \n" "${BASH_SOURCE[0]##*/}"; exit 0; } bail() { printf "error: %s\n" "$1" "${@:2}"; exit 1; } -[ -z "$1" ] && usage -[[ "$1" != v* ]] && bail "tag name should start with 'v'" +tag=$1 +[ -z "$tag" ] && usage +[[ "$tag" != v* ]] && bail "tag name should start with 'v'" changelog=$(git diff -U0 "$changelog_file" | grep '^[+][^+]' | sed 's/^[+]//;s/^###\s*//') -[ -z "$changelog" ] && bail "$changelog_file is not updated" sed "s/^version = \".*\" $version_suffix$/version = \"${1#v}\" $version_suffix/g" \ -i -- */Cargo.toml @@ -28,11 +28,11 @@ gawk -i inplace \ '/\.TH\s.*+"8".*"System Administration"/{ $4 = date } 1' man*/* git add -A -git commit -m "$commit_prefix$1" +git commit -m "$commit_prefix$tag" git show git -c user.name="$tagger_name" \ -c user.email="$tagger_email" \ -c user.signingkey="$signing_key" \ - tag -s -a "$1" -m "$tag_prefix$1" -m "$changelog" -git tag -v "$1" + tag -s -a "$tag" -m "$tag_prefix$tag" -m "$changelog" +git tag -v "$tag"