mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-16 02:21:46 +04:00
Not just output, move this whole thing out.
This commit is contained in:
parent
818a909222
commit
79528ec13e
1 changed files with 7 additions and 7 deletions
|
|
@ -82,14 +82,14 @@ def get_docker_user() -> Tuple[str, ...]: # pragma: win32 no cover
|
|||
('docker', 'system', 'info'),
|
||||
text=True,
|
||||
)
|
||||
for line in output.splitlines():
|
||||
# rootless docker has "rootless"
|
||||
# rootless podman has "rootless: true"
|
||||
if line.strip().startswith('rootless'):
|
||||
if 'false' not in line:
|
||||
return () # no -u for rootless
|
||||
break
|
||||
try:
|
||||
for line in output.splitlines():
|
||||
# rootless docker has "rootless"
|
||||
# rootless podman has "rootless: true"
|
||||
if line.strip().startswith('rootless'):
|
||||
if 'false' not in line:
|
||||
return () # no -u for rootless
|
||||
break
|
||||
return ('-u', f'{os.getuid()}:{os.getgid()}')
|
||||
except AttributeError:
|
||||
return ()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue