From 903a2c8e43641574ac46f8be56cefd9278bbeb11 Mon Sep 17 00:00:00 2001 From: muxator Date: Thu, 3 May 2018 23:54:08 +0200 Subject: [PATCH] createRelease.sh: added error checking in modify_files() Otherwise, when inserting a multiline changelog sed would with this message: sed: -e expression #1, char 27: unterminated `s' command And the script would continue with an unmodified CHANGELOG.md For simmetry, added the same check to package.json, too --- bin/createRelease.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/createRelease.sh b/bin/createRelease.sh index 5afced8f..bffa96ad 100755 --- a/bin/createRelease.sh +++ b/bin/createRelease.sh @@ -66,8 +66,11 @@ function check_api_token { function modify_files { # Add changelog text to first line of CHANGELOG.md sed -i "1s/^/${changelogText}\n/" CHANGELOG.md + [[ $? != 0 ]] && echo "Aborting: Error modifying CHANGELOG.md" && exit 1 + # Replace version number of etherpad in package.json sed -i -r "s/(\"version\"[ ]*: \").*(\")/\1$VERSION\2/" src/package.json + [[ $? != 0 ]] && echo "Aborting: Error modifying package.json" && exit 1 } function create_release_branch {