From a98552ef0e3a39b0870414bad574b10cfe55da59 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 6 Oct 2021 15:55:52 +0200 Subject: [PATCH] helpers: Fix weird 0 syntax which shfmt ain't happy with (dangling 0) --- data/helpers.d/logging | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/helpers.d/logging b/data/helpers.d/logging index 71998763e..d11fc578f 100644 --- a/data/helpers.d/logging +++ b/data/helpers.d/logging @@ -249,7 +249,7 @@ ynh_script_progression () { local weight_valuesB="$(grep --perl-regexp "^[^#]*ynh_script_progression.*-w " $0 | sed 's/.*-w[= ]\([[:digit:]]*\).*/\1/g')" # Each value will be on a different line. # Remove each 'end of line' and replace it by a '+' to sum the values. - local weight_values=$(( $(echo "$weight_valuesA" | tr '\n' '+') + $(echo "$weight_valuesB" | tr '\n' '+') 0 )) + local weight_values=$(( $(echo "$weight_valuesA" "$weight_valuesB" | grep -v -E '^\s*$' | tr '\n' '+' | sed 's/+$/+0/g') )) # max_progression is a total number of calls to this helper. # Less the number of calls with a weight value.