From aa0899aeb897a5aa625a7c5e859918539645f5f9 Mon Sep 17 00:00:00 2001 From: Thomas Levine <_@thomaslevine.com> Date: Sun, 28 Feb 2016 13:24:55 +0000 Subject: [PATCH] reuse code --- urchin | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/urchin b/urchin index 9c22f91..87a180c 100755 --- a/urchin +++ b/urchin @@ -242,18 +242,17 @@ report_outcome() { if test "$prevdir" != "$currentdir"; then echo fi - pretty_path="$(dirname -- "$path")/ - $(basename -- "$path")" + pretty_path="%s$(dirname -- "$path")/\n $(basename -- "$path")\n" case "$result" in ok) # On success, print a green '✓' printf '\033[32m✓ \033[0m' - printf '%s\n' "${pretty_path}" + printf "${pretty_path}" ;; not_ok) # On not_ok, print a red '✗' printf '\033[31m✗ \033[0m' - printf '%s\n' "${pretty_path}" + printf "${pretty_path}" # Print output captured from not_ok test in red. printf '\033[31m' @@ -262,7 +261,7 @@ report_outcome() { printf '\033[0m' ;; skip) - printf '%s\n' "${pretty_path}" + printf "${pretty_path}" ;; esac fi