From 00ef2fa3440d09304a7a3200ab6a9dfdbe4807fd Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 18 Dec 2020 19:21:43 +0100 Subject: [PATCH] if test is too fast, print 0s instead of nothing --- lib/common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common.sh b/lib/common.sh index c68b4b1..ebc86b0 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -172,7 +172,7 @@ stop_timer () { # Add a 's' for plural values [ $hours -eq 1 ] && phours="${phours}, " || test -z "$phours" || phours="${phours}s, " [ $minutes -eq 1 ] && pminutes="${pminutes}, " || test -z "$pminutes" || pminutes="${pminutes}s, " - [ $seconds -gt 1 ] && pseconds="${pseconds}s" + [ $seconds -gt 1 ] && pseconds="${pseconds}s" || pseconds="0s" time="${phours}${pminutes}${pseconds} ($(date '+%T'))" if [ $1 -eq 2 ]; then