Fix Windows whereis

This commit is contained in:
Fierelier 2024-06-05 13:14:19 +02:00
parent b3565c1c07
commit 8d598ed971

View File

@ -7,10 +7,15 @@ def readJsonFile(file):
global whereis
def whereis(cmd):
if (
os.path.isfile(cmd) and
os.access(cmd,os.X_OK)
): return cmd
if lv["osName"] != "windows":
if (
os.path.isfile(cmd) and
os.access(cmd,os.X_OK)
): return cmd
else:
if (
os.path.isfile(cmd)
): return cmd
paths = os.environ["PATH"].split(os.pathsep)
if lv["osName"] == "windows":
@ -21,9 +26,8 @@ def whereis(cmd):
if lv["osName"] == "windows":
for pathext in pathexts:
if (
os.path.isfile(ffile + pathext) and
os.access(ffile,os.X_OK)
): return ffile
os.path.isfile(ffile + pathext)
): return ffile + pathext
else:
if (
os.path.isfile(ffile) and