Skip to content

Commit c7eb45c

Browse files
author
Will Fleming
committed
fix constructing multi-line pull request description
It appears `hub` doesn't like escaped chars in strings with `-m`. This switches around to writing the message to a file and using that instead.
1 parent b837302 commit c7eb45c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

bin/prep-release

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,15 @@ git commit -m "Release v$version"
3434
git push origin $branch
3535

3636
compare_link="https://github.com/codeclimate/codeclimate/compare/${old_version}...$(git rev-parse --short $branch)"
37+
pr_description_file=$(mktemp -t cc_commit_message) || exit 1
38+
printf "Release v$version\n\n$s\n" "$compare_link" > "$pr_description_file"
3739
if command -v hub > /dev/null 2>&1; then
38-
hub pull-request -m "Release v$version\n\n$compare_link"
40+
hub pull-request -F "$pr_description_file"
3941
elif command -v gh > /dev/null 2>&1; then
40-
gh pull-request -m "Release v$version\n\n$compare_link"
42+
gh pull-request -F "$pr_description_file"
4143
else
4244
echo "hub not installed? Please open the PR manually" >&2
4345
fi
46+
rm "$commit_message_file"
4447

4548
echo "After merging the version-bump PR, run bin/release"

0 commit comments

Comments
 (0)