From b4c677d8ffccd0ceb6de43a51a6ccf296d9cb5e3 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 26 Aug 2025 22:38:36 +0800 Subject: improve download tips --- .../private/action/require/impl/actions/download.lua | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/xmake/modules/private/action/require/impl/actions/download.lua b/xmake/modules/private/action/require/impl/actions/download.lua index 0dcb4bf98..979c17971 100644 --- a/xmake/modules/private/action/require/impl/actions/download.lua +++ b/xmake/modules/private/action/require/impl/actions/download.lua @@ -217,6 +217,12 @@ function _download(package, url, sourcedir, opt) -- we do not extract it if we download only it. if opt.download_only then + tty.erase_line_to_start().cr() + if cached then + cprint("${yellow} => ${clear}download %s .. ${color.success}cached", url) + else + cprint("${yellow} => ${clear}download %s .. ${color.success}${text.success}", url) + end return end @@ -440,15 +446,6 @@ function main(package, opt) } if ok then - -- download only packages, we need not to install it, so we need flush console output - if opt.download_only then - tty.erase_line_to_start().cr() - if git.checkurl(url) then - cprint("${yellow} => ${clear}clone %s %s .. ${color.success}${text.success}", url, package:version_str()) - else - cprint("${yellow} => ${clear}download %s .. ${color.success}${text.success}", url) - end - end break end end -- cgit v1.3.1