Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 42000c4

Browse files
author
Alex Hutton
committed
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.
1 parent 63f65a4 commit 42000c4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

pre_commit/parse_shebang.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@ def find_executable(exe, _environ=None):
5353
environ = _environ if _environ is not None else os.environ
5454

5555
if 'PATHEXT' in environ:
56-
possible_exe_names = (exe,) + tuple(
56+
possible_exe_names = tuple(
5757
exe + ext.lower() for ext in environ['PATHEXT'].split(os.pathsep)
58-
)
58+
) + (exe,)
59+
5960
else:
6061
possible_exe_names = (exe,)
6162

0 commit comments

Comments
 (0)