diff options
| author | ruki <[email protected]> | 2024-05-15 22:30:53 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-05-15 22:30:53 +0800 |
| commit | 860a3550f65749896d2cdbb7fd32c7cba64aed62 (patch) | |
| tree | 13bfd4dad7c12806e911539d0f6d47462ca233f1 | |
| parent | 2fe0781ca0776ff3878aeab1d50da300a7102a6f (diff) | |
add where to find_program
| -rw-r--r-- | xmake/core/sandbox/modules/import/lib/detect/find_program.lua | 10 |
1 files changed, 10 insertions, 0 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 baa180b4b..160cae2d6 100644 --- a/xmake/core/sandbox/modules/import/lib/detect/find_program.lua +++ b/xmake/core/sandbox/modules/import/lib/detect/find_program.lua @@ -205,6 +205,16 @@ function sandbox_lib_detect_find_program._find(name, paths, opt) end end end + + -- attempt to find it use `where.exe program` command + local ok, program_path = os.iorunv("where.exe", {name}) + if ok and program_path then + program_path = program_path:trim() + local program_path_real = sandbox_lib_detect_find_program._check(program_path, opt) + if program_path_real then + return program_path_real + end + end else -- attempt to find it use `which program` command local ok, program_path = os.iorunv("which", {name}) |
