Fix eslint on windows

- The bare exe was the first filename attempted to match,
  this changes means it will be matched last, allowing other files
  to be matched if they exist. The result is that eslint now works
  on Windows.
This commit is contained in:
Alex Hutton 2017-02-10 18:09:00 +11:00
parent 63f65a419c
commit 42000c4521

View file

@ -53,9 +53,10 @@ def find_executable(exe, _environ=None):
environ = _environ if _environ is not None else os.environ environ = _environ if _environ is not None else os.environ
if 'PATHEXT' in environ: if 'PATHEXT' in environ:
possible_exe_names = (exe,) + tuple( possible_exe_names = tuple(
exe + ext.lower() for ext in environ['PATHEXT'].split(os.pathsep) exe + ext.lower() for ext in environ['PATHEXT'].split(os.pathsep)
) ) + (exe,)
else: else:
possible_exe_names = (exe,) possible_exe_names = (exe,)