mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-16 10:31:46 +04:00
Add more checks for mingw platform
When the mingw platform is detected, several different path routines will be applied.
This commit is contained in:
parent
9850eae10a
commit
26c6af21ef
4 changed files with 47 additions and 5 deletions
|
|
@ -14,6 +14,7 @@ from pre_commit.clientlib import load_config
|
|||
from pre_commit.repository import all_hooks
|
||||
from pre_commit.repository import install_hook_envs
|
||||
from pre_commit.util import cmd_output
|
||||
from pre_commit.util import is_mingw
|
||||
from pre_commit.util import make_executable
|
||||
from pre_commit.util import mkdirp
|
||||
from pre_commit.util import resource_text
|
||||
|
|
@ -48,8 +49,8 @@ def is_our_script(filename):
|
|||
|
||||
|
||||
def shebang():
|
||||
if sys.platform == 'win32':
|
||||
py = 'python{}'.format(sys.version_info[0])
|
||||
if sys.platform == 'win32' and not is_mingw():
|
||||
py = 'python'
|
||||
else:
|
||||
# Homebrew/homebrew-core#35825: be more timid about appropriate `PATH`
|
||||
path_choices = [p for p in os.defpath.split(os.pathsep) if p]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue