diff options
| -rw-r--r-- | xmake/core/sandbox/modules/import/core/sandbox/module.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/xmake/core/sandbox/modules/import/core/sandbox/module.lua b/xmake/core/sandbox/modules/import/core/sandbox/module.lua index 939478150..fc38747ba 100644 --- a/xmake/core/sandbox/modules/import/core/sandbox/module.lua +++ b/xmake/core/sandbox/modules/import/core/sandbox/module.lua @@ -218,9 +218,17 @@ function core_sandbox_module._load_from_binary(module_fullpath, opt) for _, arg in ipairs(table.pack(...)) do table.insert(argv, tostring(arg)) end - local ok, outdata, errdata = os.iorunv(binaryfile, argv, {curdir = module_bindir}) + local ok, outdata, errdata, errors = os.iorunv(binaryfile, argv) if ok then return outdata + else + if not errors then + errors = errdata or "" + if #errors:trim() == 0 then + errors = outdata or "" + end + end + os.raise({errors = errors, stderr = errdata, stdout = outdata}) end end end |
