[fix] Only call progress callback if arg passed

This commit is contained in:
William Wernert
2020-12-28 13:57:44 -05:00
parent 7050b1fce5
commit 1e0525b1ad

View File

@@ -158,14 +158,14 @@ wait_for_apt() {
local count=0
while [[ "$count" -lt "$retry_count" ]]; do
if __check_apt_lock; then
if [ -z "$progress_callback" ]; then
if [[ -z $progress_callback ]]; then
echo "$lock_msg"
echo "$retry_msg"
else
$progress_callback "$retry_msg"
fi
else
$progress_callback "$old_text"
[[ -z $progress_callback ]] && $progress_callback "$old_text"
return 0
fi
sleep "$retry_timeout"