mirror of
https://github.com/chatmail/relay.git
synced 2026-05-10 16:04:37 +00:00
avoid initial runs to show acmetool not found errors
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
from subprocess import CalledProcessError, check_output
|
||||
from subprocess import DEVNULL, CalledProcessError, check_output
|
||||
|
||||
|
||||
def shell(command, fail_ok=False):
|
||||
print(f"$ {command}")
|
||||
args = dict(shell=True)
|
||||
if fail_ok:
|
||||
args["stderr"] = DEVNULL
|
||||
try:
|
||||
return check_output(command, shell=True).decode().rstrip()
|
||||
return check_output(command, **args).decode().rstrip()
|
||||
except CalledProcessError:
|
||||
if not fail_ok:
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user