aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/release
diff options
context:
space:
mode:
authorGravatar Androbin <robin.richtsfeld@gmail.com>2017-06-27 13:47:43 +0200
committerGravatar Marcel Hlopko <hlopko@google.com>2017-06-27 15:06:22 +0200
commitcfb2ec0ad1ab4efcf3e332fb74e91a9cbdd10053 (patch)
treecfdd7affe0d2e6d70d0d157948148ff81f07193d /scripts/release
parentfa46172bc3b9bd2398a9d79a05fc5cd55f6059ad (diff)
Minor Bash improvements
Diffstat (limited to 'scripts/release')
-rwxr-xr-xscripts/release/common.sh2
-rwxr-xr-xscripts/release/release.sh14
2 files changed, 9 insertions, 7 deletions
diff --git a/scripts/release/common.sh b/scripts/release/common.sh
index 7cd6d0b61e..ca8ebd45d7 100755
--- a/scripts/release/common.sh
+++ b/scripts/release/common.sh
@@ -89,7 +89,7 @@ function get_release_notes() {
# candidate in this release.
function get_release_branch() {
local branch_name=$(git_get_branch)
- if [ -z "$(get_release_name)" -o -z "$(get_release_candidate)" ]; then
+ if [ -z "$(get_release_name)" ] || [ -z "$(get_release_candidate)" ]; then
echo "Not a release branch: ${branch_name}." >&2
exit 1
fi
diff --git a/scripts/release/release.sh b/scripts/release/release.sh
index e3fb691cbe..13c874c36b 100755
--- a/scripts/release/release.sh
+++ b/scripts/release/release.sh
@@ -102,10 +102,12 @@ function create_release_commit() {
trap "rm -f ${tmpfile}" EXIT
echo -n "## ${infos}" >${tmpfile}
if [ -f "${changelog_path}" ]; then
- echo >>${tmpfile}
- echo >>${tmpfile}
- cat "${changelog_path}" >>${tmpfile}
- echo >>${tmpfile}
+ {
+ echo
+ echo
+ cat "${changelog_path}"
+ echo
+ } >> ${tmpfile}
fi
cat "${tmpfile}" > ${changelog_path}
git add ${changelog_path}
@@ -313,7 +315,7 @@ function do_release() {
echo -n "You are about to release branch ${branch} in tag ${tag_name}, confirm? [y/N] "
read answer
- if [ "$answer" = "y" -o "$answer" = "Y" ]; then
+ if [ "$answer" = "y" ] || [ "$answer" = "Y" ]; then
echo "Creating the release commit"
create_release_commit "${tag_name}"
set_release_name "${tag_name}"
@@ -352,7 +354,7 @@ function abandon_release() {
local tag_name=$(get_release_name)
echo -n "You are about to abandon release ${tag_name}, confirm? [y/N] "
read answer
- if [ "$answer" = "y" -o "$answer" = "Y" ]; then
+ if [ "$answer" = "y" ] || [ "$answer" = "Y" ]; then
git notes --ref=release remove 2>/dev/null || true
git notes --ref=release-candidate remove 2>/dev/null || true
git checkout -q master >/dev/null