From c77bff12b4fbce12b274efb56e1d963d293a34ea Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Mon, 17 Aug 2020 22:09:21 +0200 Subject: [PATCH] Check git mode also in WSL --- pre_commit_hooks/check_executables_have_shebangs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pre_commit_hooks/check_executables_have_shebangs.py b/pre_commit_hooks/check_executables_have_shebangs.py index a02d2a9..29556ad 100644 --- a/pre_commit_hooks/check_executables_have_shebangs.py +++ b/pre_commit_hooks/check_executables_have_shebangs.py @@ -1,5 +1,6 @@ """Check that executable text files have a shebang.""" import argparse +import platform import shlex import sys from typing import List @@ -21,7 +22,7 @@ def zsplit(s: str) -> List[str]: def check_executables(paths: List[str]) -> int: - if sys.platform == 'win32': # pragma: win32 cover + if sys.platform == 'win32' or "microsoft" in platform.uname()[3].lower(): # pragma: win32 cover return _check_git_filemode(paths) else: # pragma: win32 no cover retv = 0