Fix Windows whereis
This commit is contained in:
parent
b3565c1c07
commit
8d598ed971
@ -7,10 +7,15 @@ def readJsonFile(file):
|
||||
|
||||
global whereis
|
||||
def whereis(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
|
||||
|
Loading…
Reference in New Issue
Block a user