diff options
| author | ruki <[email protected]> | 2019-04-18 00:49:10 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-04-17 22:55:01 +0800 |
| commit | fe7395793bf186b54c6ccb777b9086a9e2b5d2e9 (patch) | |
| tree | 6b306704c3c7598f5dd55aca9d88580eb98f4a3b /xmake/actions/require/impl | |
| parent | da2e7200b81638ffae4ca46594b1ee8f37a6dca0 (diff) | |
improve vcpkg and package errors tip
Diffstat (limited to 'xmake/actions/require/impl')
| -rw-r--r-- | xmake/actions/require/impl/action/install.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/xmake/actions/require/impl/action/install.lua b/xmake/actions/require/impl/action/install.lua index 9463ce269..8e1a0c658 100644 --- a/xmake/actions/require/impl/action/install.lua +++ b/xmake/actions/require/impl/action/install.lua @@ -222,11 +222,12 @@ function main(package) function (errors) -- show or save the last errors + local errorfile = path.join(package:installdir("logs"), "install.txt") 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) + io.writefile(errorfile, errors .. "\n") end end @@ -245,11 +246,16 @@ function main(package) if not os.isdir(installdir_failed) then os.cp(installdir, installdir_failed) end + errorfile = path.join(installdir_failed, "logs", "install.txt") end os.tryrm(installdir) -- failed if not package:requireinfo().optional then + if os.isfile(errorfile) then + print("if you want to get verbose errors, please see:") + cprint(" -> ${bright}%s${clear}", errorfile) + end raise("install failed!") end end |
