From 251e23a3fa09ed04643c4925c63ec65109e18840 Mon Sep 17 00:00:00 2001 From: John D Pell <52194+gaelicWizard@users.noreply.github.com> Date: Fri, 31 Dec 2021 01:11:24 -0800 Subject: [PATCH] lib/helpers: use `awk` to count lines instead of piping to `wc -l` Co-authored-by: Kostas Giapis <45879751+tsiflimagas@users.noreply.github.com> --- lib/helpers.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/helpers.bash b/lib/helpers.bash index d14e3352..ac12c283 100644 --- a/lib/helpers.bash +++ b/lib/helpers.bash @@ -329,7 +329,7 @@ function _bash-it-update-() { fi for i in $(git rev-list --merges --first-parent "${revision}"); do - num_of_lines=$(git log -1 --format=%B "$i" | awk 'NF' | wc -l) + num_of_lines=$(git log -1 --format=%B "$i" | awk '!/^[[:space:]]*$ {++i} END{print i}') if [[ "$num_of_lines" -eq 1 ]]; then description="%s" else