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,7 +82,6 @@ def get_docker_user() -> Tuple[str, ...]: # pragma: win32 no cover
|
||||||
('docker', 'system', 'info'),
|
('docker', 'system', 'info'),
|
||||||
text=True,
|
text=True,
|
||||||
)
|
)
|
||||||
try:
|
|
||||||
for line in output.splitlines():
|
for line in output.splitlines():
|
||||||
# rootless docker has "rootless"
|
# rootless docker has "rootless"
|
||||||
# rootless podman has "rootless: true"
|
# rootless podman has "rootless: true"
|
||||||
|
|
@ -90,6 +89,7 @@ def get_docker_user() -> Tuple[str, ...]: # pragma: win32 no cover
|
||||||
if 'false' not in line:
|
if 'false' not in line:
|
||||||
return () # no -u for rootless
|
return () # no -u for rootless
|
||||||
break
|
break
|
||||||
|
try:
|
||||||
return ('-u', f'{os.getuid()}:{os.getgid()}')
|
return ('-u', f'{os.getuid()}:{os.getgid()}')
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return ()
|
return ()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue