diff options
| author | ruki <[email protected]> | 2024-12-09 23:15:05 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-12-09 13:31:01 +0800 |
| commit | b5fa0137f5047f1d41596d2077f05770708a758c (patch) | |
| tree | dcbab3cdb9c78ca69f83d80fa2c11c04a1008c3a | |
| parent | 46b99517934618116d6b280ffac819ba830af7db (diff) | |
improve to install package errors
| -rw-r--r-- | xmake/modules/private/action/require/impl/actions/install.lua | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/xmake/modules/private/action/require/impl/actions/install.lua b/xmake/modules/private/action/require/impl/actions/install.lua index 3b7a5e04e..5e0c2c542 100644 --- a/xmake/modules/private/action/require/impl/actions/install.lua +++ b/xmake/modules/private/action/require/impl/actions/install.lua @@ -542,17 +542,21 @@ function main(package) -- failed if not package:requireinfo().optional then if os.isfile(errorfile) then - if errors then - print("") - for idx, line in ipairs(errors:split("\n")) do - print(line) - if idx > 16 then - break + if errors and option.get("diagnosis") then + print(tostring(errors)) + else + if errors then + print("") + for idx, line in ipairs(errors:split("\n")) do + print(line) + if idx > 16 then + break + end end end + cprint("if you want to get more verbose errors, please see:") + cprint(" -> ${bright}%s", errorfile) end - cprint("if you want to get more verbose errors, please see:") - cprint(" -> ${bright}%s", errorfile) end raise("install failed!") end |
