summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-03-29 23:25:27 +0800
committerruki <[email protected]>2019-03-29 14:32:44 +0800
commitf0d0d54a71d3850423e25e46b76c1b468ebdd1ff (patch)
treed45431fff7d6c9cd8fbfdbc4d58c89ba71f62092
parente28cf38bc82fa657fb68f8684dfad986e51df208 (diff)
save download and install errors for package
-rw-r--r--xmake/actions/require/impl/action/download.lua10
-rw-r--r--xmake/actions/require/impl/action/install.lua10
2 files changed, 14 insertions, 6 deletions
diff --git a/xmake/actions/require/impl/action/download.lua b/xmake/actions/require/impl/action/download.lua
index 9ce7ac026..36518b248 100644
--- a/xmake/actions/require/impl/action/download.lua
+++ b/xmake/actions/require/impl/action/download.lua
@@ -208,9 +208,13 @@ function main(package)
{
function (errors)
- -- verbose?
- if (option.get("verbose") or option.get("diagnosis")) and errors then
- cprint("${dim color.error}error: ${clear}%s", errors)
+ -- show or save the last errors
+ if errors then
+ if (option.get("verbose") or option.get("diagnosis")) then
+ cprint("${dim color.error}error: ${clear}%s", errors)
+ else
+ io.writefile(path.join(package:installdir("logs"), "download.txt"), errors)
+ end
end
-- trace
diff --git a/xmake/actions/require/impl/action/install.lua b/xmake/actions/require/impl/action/install.lua
index 2f4efed87..0fbac911c 100644
--- a/xmake/actions/require/impl/action/install.lua
+++ b/xmake/actions/require/impl/action/install.lua
@@ -225,9 +225,13 @@ function main(package)
{
function (errors)
- -- verbose?
- if (option.get("verbose") or option.get("diagnosis")) and errors then
- cprint("${dim color.error}error: ${clear}%s", errors)
+ -- show or save the last errors
+ if errors then
+ if (option.get("verbose") or option.get("diagnosis")) then
+ cprint("${dim color.error}error: ${clear}%s", errors)
+ else
+ io.writefile(path.join(package:installdir("logs"), "install.txt"), errors)
+ end
end
-- trace