mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 18:11:48 +04:00
fix #1243 - the -u option is not necessary on podman
This commit is contained in:
parent
79359ed4e2
commit
7c16c3e53f
1 changed files with 6 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import hashlib
|
||||
import os
|
||||
import subprocess
|
||||
from typing import Sequence
|
||||
from typing import Tuple
|
||||
|
||||
|
|
@ -78,7 +79,11 @@ def install_environment(
|
|||
|
||||
def get_docker_user() -> Tuple[str, ...]: # pragma: win32 no cover
|
||||
try:
|
||||
return ('-u', f'{os.getuid()}:{os.getgid()}')
|
||||
ver_cmd = 'docker', '--version'
|
||||
if subprocess.check_output(ver_cmd).startswith(b'podman version '):
|
||||
return ()
|
||||
else:
|
||||
return ('-u', f'{os.getuid()}:{os.getgid()}')
|
||||
except AttributeError:
|
||||
return ()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue