From ad1837859bedc5283b69cfcabee6d2ba5e4ee71e Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Tue, 17 Aug 2021 16:35:42 +0200 Subject: fix(updater): fix reset ANSI escape code for resetting underline format --- tools/upgrade.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/upgrade.sh b/tools/upgrade.sh index 38fac3ce0..e9f8bc0f9 100755 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -30,7 +30,7 @@ if [ -t 1 ]; then BOLD=$(printf '\033[1m') DIM=$(printf '\033[2m') UNDER=$(printf '\033[4m') - RESET=$(printf '\033[m') + RESET=$(printf '\033[0m') fi # Update upstream remote to ohmyzsh org -- cgit v1.2.3-70-g09d2 From 7336ebcd8f095b0ead7e1e39bdc2fff57275acfd Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Mon, 6 Sep 2021 13:30:16 +0200 Subject: feat(changelog): change style of `BREAKING CHANGES` header --- tools/changelog.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/changelog.sh b/tools/changelog.sh index 6913ae49a..b4b8d0c9e 100755 --- a/tools/changelog.sh +++ b/tools/changelog.sh @@ -285,8 +285,9 @@ function display-release { (( $#breaking != 0 )) || return 0 case "$output" in + text) fmt:header "\e[31mBREAKING CHANGES" 3 ;; raw) fmt:header "BREAKING CHANGES" 3 ;; - text|md) fmt:header "⚠ BREAKING CHANGES" 3 ;; + md) fmt:header "BREAKING CHANGES ⚠" 3 ;; esac local hash subject -- cgit v1.2.3-70-g09d2 From f341c8c20646bd82d5d84fae32f68b760e0f1be0 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Tue, 7 Sep 2021 17:08:46 +0200 Subject: feat(changelog): print BREAKING CHANGE messages in a prettier way --- tools/changelog.sh | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'tools') diff --git a/tools/changelog.sh b/tools/changelog.sh index b4b8d0c9e..966e91c25 100755 --- a/tools/changelog.sh +++ b/tools/changelog.sh @@ -181,6 +181,12 @@ function display-release { return fi + # Get length of longest scope for padding + local max_scope=0 + for hash in ${(k)scopes}; do + max_scope=$(( max_scope < ${#scopes[$hash]} ? ${#scopes[$hash]} : max_scope )) + done + ##* Formatting functions # Format the hash according to output format @@ -220,18 +226,13 @@ function display-release { #* Uses $scopes (A) and $hash from outer scope local scope="${1:-${scopes[$hash]}}" - # Get length of longest scope for padding - local max_scope=0 padding=0 - for hash in ${(k)scopes}; do - max_scope=$(( max_scope < ${#scopes[$hash]} ? ${#scopes[$hash]} : max_scope )) - done - # If no scopes, exit the function if [[ $max_scope -eq 0 ]]; then return fi # Get how much padding is required for this scope + local padding=0 padding=$(( max_scope < ${#scope} ? 0 : max_scope - ${#scope} )) padding="${(r:$padding:: :):-}" @@ -290,11 +291,15 @@ function display-release { md) fmt:header "BREAKING CHANGES ⚠" 3 ;; esac - local hash subject + local hash message + local wrap_width=$(( (COLUMNS < 100 ? COLUMNS : 100) - 3 )) for hash message in ${(kv)breaking}; do - echo " - $(fmt:hash) $(fmt:scope)$(fmt:subject "${message}")" - done | sort - echo + # Format the BREAKING CHANGE message by word-wrapping it at maximum 100 characters + # (use $COLUMNS if smaller than 100), and adding a 3-space left padding. + message="$(fmt -w $wrap_width <<< "$message" | sed 's/^/ /')" + # Display hash and scope first, and then the full message with newline separators + echo " - $(fmt:hash) $(fmt:scope)\n\n$(fmt:subject "$message")\n" + done } function display:type { -- cgit v1.2.3-70-g09d2 From 37a60eebc107c08047d4b5716c1c1760104aa25d Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Tue, 7 Sep 2021 17:13:46 +0200 Subject: chore(changelog): fix first-letter uppercase in breaking change messages --- tools/changelog.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'tools') diff --git a/tools/changelog.sh b/tools/changelog.sh index 966e91c25..7329a9526 100755 --- a/tools/changelog.sh +++ b/tools/changelog.sh @@ -294,11 +294,12 @@ function display-release { local hash message local wrap_width=$(( (COLUMNS < 100 ? COLUMNS : 100) - 3 )) for hash message in ${(kv)breaking}; do - # Format the BREAKING CHANGE message by word-wrapping it at maximum 100 characters - # (use $COLUMNS if smaller than 100), and adding a 3-space left padding. - message="$(fmt -w $wrap_width <<< "$message" | sed 's/^/ /')" - # Display hash and scope first, and then the full message with newline separators - echo " - $(fmt:hash) $(fmt:scope)\n\n$(fmt:subject "$message")\n" + # Format the BREAKING CHANGE message by word-wrapping it at maximum 100 + # characters (use $COLUMNS if smaller than 100) + message="$(fmt -w $wrap_width <<< "$message")" + # Display hash and scope in their own line, and then the full message with + # blank lines as separators and a 3-space left padding + echo " - $(fmt:hash) $(fmt:scope)\n\n$(fmt:subject "$message" | sed 's/^/ /')\n" done } -- cgit v1.2.3-70-g09d2