mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 07:35:05 -04:00
createRelease.sh: changelog editing failed for multiline messages
sed does not accept multiline strings in its replacement text. Let's replace newlines with literal "\n" in modify_files()
This commit is contained in:
parent
903a2c8e43
commit
6dbeca217e
1 changed files with 10 additions and 1 deletions
|
@ -65,7 +65,16 @@ function check_api_token {
|
||||||
|
|
||||||
function modify_files {
|
function modify_files {
|
||||||
# Add changelog text to first line of CHANGELOG.md
|
# Add changelog text to first line of CHANGELOG.md
|
||||||
sed -i "1s/^/${changelogText}\n/" CHANGELOG.md
|
|
||||||
|
msg=""
|
||||||
|
# source: https://unix.stackexchange.com/questions/9784/how-can-i-read-line-by-line-from-a-variable-in-bash#9789
|
||||||
|
while IFS= read -r line
|
||||||
|
do
|
||||||
|
# replace newlines with literal "\n" for using with sed
|
||||||
|
msg+="$line\n"
|
||||||
|
done < <(printf '%s\n' "${changelogText}")
|
||||||
|
|
||||||
|
sed -i "1s/^/${msg}\n/" CHANGELOG.md
|
||||||
[[ $? != 0 ]] && echo "Aborting: Error modifying CHANGELOG.md" && exit 1
|
[[ $? != 0 ]] && echo "Aborting: Error modifying CHANGELOG.md" && exit 1
|
||||||
|
|
||||||
# Replace version number of etherpad in package.json
|
# Replace version number of etherpad in package.json
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue