mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-15 21:40:19 -06:00
allow default language_version of system when homedir is /
This commit is contained in:
@@ -37,8 +37,14 @@ def exe_exists(exe: str) -> bool:
|
||||
common = None
|
||||
|
||||
return (
|
||||
not SHIMS_RE.search(found) and # it is not in a /shims/ directory
|
||||
common != homedir # it is not in the home directory
|
||||
# it is not in a /shims/ directory
|
||||
not SHIMS_RE.search(found) and
|
||||
(
|
||||
# the homedir is / (docker, service user, etc.)
|
||||
os.path.dirname(homedir) == homedir or
|
||||
# the exe is not contained in the home directory
|
||||
common != homedir
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user