From 8f40dc67f661f46de7a073ea079587faebf0f1af Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 18 Mar 2024 23:52:01 +0800 Subject: use new progress --- xmake/modules/utils/progress.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xmake/modules/utils/progress.lua') diff --git a/xmake/modules/utils/progress.lua b/xmake/modules/utils/progress.lua index 2655f0701..aefaef1af 100644 --- a/xmake/modules/utils/progress.lua +++ b/xmake/modules/utils/progress.lua @@ -75,7 +75,7 @@ end -- show the message with progress function show(progress, format, ...) - progress = math.floor(progress) + progress = type(progress) == "table" and progress:percent() or math.floor(progress) local progress_prefix = "${color.build.progress}" .. theme.get("text.build.progress_format") .. ":${clear} " if option.get("verbose") then cprint(progress_prefix .. "${dim}" .. format, progress, ...) @@ -114,7 +114,7 @@ end -- get the message text with progress function text(progress, format, ...) - progress = math.floor(progress) + progress = type(progress) == "table" and progress:percent() or math.floor(progress) local progress_prefix = "${color.build.progress}" .. theme.get("text.build.progress_format") .. ":${clear} " if option.get("verbose") then return string.format(progress_prefix .. "${dim}" .. format, progress, ...) -- cgit v1.3.1