summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-12-24 00:19:23 +0800
committerruki <[email protected]>2020-12-24 00:19:23 +0800
commit84f4b0127ebe1d646a996ead1ee9127a831dece4 (patch)
tree6809fc8009c630ba0fa07cda084c397d577e07a1
parentffd79490c0398a25a6c8920604e5718878973833 (diff)
improve find_program
-rw-r--r--xmake/core/sandbox/modules/import/lib/detect/find_program.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/xmake/core/sandbox/modules/import/lib/detect/find_program.lua b/xmake/core/sandbox/modules/import/lib/detect/find_program.lua
index 5397e488e..a2cd2105e 100644
--- a/xmake/core/sandbox/modules/import/lib/detect/find_program.lua
+++ b/xmake/core/sandbox/modules/import/lib/detect/find_program.lua
@@ -55,7 +55,12 @@ function sandbox_lib_detect_find_program._check(program, opt)
-- no check script? attempt to run it directly
if not opt.check then
- return 0 == os.execv(program, {"--version"}, {stdout = os.nuldev(), stderr = os.nuldev(), envs = opt.envs})
+ local stdout, stderr
+ if not option.get("diagnosis") then
+ stdout = os.nuldev()
+ stderr = os.nuldev()
+ end
+ return 0 == os.execv(program, {"--version"}, {stdout = stdout, stderr = stderr, envs = opt.envs})
end
-- check it