summaryrefslogtreecommitdiff
path: root/xmake/modules/utils/progress.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2024-03-18 23:52:01 +0800
committerruki <[email protected]>2024-03-18 23:52:01 +0800
commit8f40dc67f661f46de7a073ea079587faebf0f1af (patch)
tree9a56acb9dac1c1b90c13fd34a8d59acf20a3150b /xmake/modules/utils/progress.lua
parentca16db30058d8a512d73a7bee28e57f72de4c338 (diff)
use new progress
Diffstat (limited to 'xmake/modules/utils/progress.lua')
-rw-r--r--xmake/modules/utils/progress.lua4
1 files changed, 2 insertions, 2 deletions
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, ...)