mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-16 02:21:46 +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 hashlib
|
||||||
import os
|
import os
|
||||||
|
import subprocess
|
||||||
from typing import Sequence
|
from typing import Sequence
|
||||||
from typing import Tuple
|
from typing import Tuple
|
||||||
|
|
||||||
|
|
@ -78,6 +79,10 @@ def install_environment(
|
||||||
|
|
||||||
def get_docker_user() -> Tuple[str, ...]: # pragma: win32 no cover
|
def get_docker_user() -> Tuple[str, ...]: # pragma: win32 no cover
|
||||||
try:
|
try:
|
||||||
|
ver_cmd = 'docker', '--version'
|
||||||
|
if subprocess.check_output(ver_cmd).startswith(b'podman version '):
|
||||||
|
return ()
|
||||||
|
else:
|
||||||
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