From 4ed252e894003195e74f7b491693174cb06294ff Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Wed, 17 Apr 2019 20:37:19 +0200 Subject: [PATCH] Fix behavior with --last --- data/helpers.d/print | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/data/helpers.d/print b/data/helpers.d/print index 8a2e1ee79..1558e4d21 100644 --- a/data/helpers.d/print +++ b/data/helpers.d/print @@ -260,6 +260,10 @@ ynh_script_progression () { # Build $progression_bar from progress_string(0,1,2) according to $effective_progression and the weight of the current task # expected_progression is the progression expected after the current task local expected_progression="$(( ( $increment_progression + $weight ) * $scale / $max_progression - $effective_progression ))" + if [ $last -eq 1 ] + then + expected_progression=0 + fi # left_progression is the progression not yet done local left_progression="$(( $scale - $effective_progression - $expected_progression ))" # Build the progression bar with $effective_progression, work done, $expected_progression, current work and $left_progression, work to be done.