File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
xmake/core/sandbox/modules/import/lib/detect Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -77,14 +77,15 @@ function sandbox_lib_detect_find_program._check(program, opt)
7777 opt = opt or {}
7878 local findname = program
7979 if os .subhost () == " windows" then
80- if not opt .shell and not program :endswith (" .exe" ) and not program :endswith (" .cmd" ) and not program :endswith (" .bat" ) then
80+ local ext = path .extension (program ):lower ()
81+ if not opt .shell and ext ~= " .exe" and ext ~= " .cmd" and ext ~= " .bat" then
8182 findname = program .. " .exe"
8283 end
8384 elseif os .subhost () == " msys" and os .isfile (program ) and os .filesize (program ) < 256 then
8485 -- only a sh script on msys2? e.g. c:/msys64/usr/bin/7z
8586 -- we need to use sh to wrap it, otherwise os.exec cannot run it
86- local program_lower = program :lower ()
87- if not program_lower : endswith ( " .exe" ) and not program_lower : endswith ( " .cmd" ) and not program_lower : endswith ( " .bat" ) then
87+ local ext = path . extension ( program ) :lower ()
88+ if ext ~= " .exe" and ext ~= " .cmd" and ext ~= " .bat" then
8889 program = " sh " .. program
8990 end
9091 findname = program
You can’t perform that action at this time.
0 commit comments