diff options
author | Damien Martin-Guillerez <dmarting@google.com> | 2015-08-26 12:42:54 +0000 |
---|---|---|
committer | Philipp Wollermann <philwo@google.com> | 2015-08-27 14:44:16 +0000 |
commit | 8dc5fb2c70f2ff9db3f804b0bba20edf4a512f78 (patch) | |
tree | 17a9dbf994c3281e54a7f3695f6788463d73cd03 /scripts/release/relnotes.sh | |
parent | 8137e2a320e2d835dda7d7ae8aa6996bf36819e6 (diff) |
Fix word wrapping determinism on BSD / Linux
fmt behaves totally differently depending on the version and on the
OS, use fold instead that has a consistent behaviour accross platform.
Tested with bazel test //scripts/release/... on OSX and Linux.
--
MOS_MIGRATED_REVID=101567574
Diffstat (limited to 'scripts/release/relnotes.sh')
-rwxr-xr-x | scripts/release/relnotes.sh | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/scripts/release/relnotes.sh b/scripts/release/relnotes.sh index 15abbd1cb7..7071f7186a 100755 --- a/scripts/release/relnotes.sh +++ b/scripts/release/relnotes.sh @@ -97,16 +97,10 @@ function get_release_notes() { done } -# fmt behaves a bit different on GNU/Linux than on BSDs. -if [ "$(uname -s | tr 'A-Z' 'a-z')" = "linux" ]; then - function wrap_text() { - fmt -w $1 -g $1 - } -else - function wrap_text() { - fmt -w $1 - } -fi +# fmt behaves differently on *BSD and on GNU/Linux, use fold. +function wrap_text() { + fold -s -w $1 | sed 's/ *$//' +} # Returns the list of release notes in arguments into a list of points in # a markdown list. The release notes are wrapped to 70 characters so it |