mirror of
https://codeberg.org/privacy1st/exec-notify
synced 2024-12-22 23:16:04 +01:00
fix
This commit is contained in:
parent
3ba46f24fe
commit
fc2e8094a6
@ -3,7 +3,7 @@
|
||||
|
||||
[metadata]
|
||||
name = de.p1st.exec_notify
|
||||
version = 0.1.9
|
||||
version = 0.1.10
|
||||
author = Daniel Langbein
|
||||
author_email = daniel@systemli.org
|
||||
description = mail notification if command fails
|
||||
|
@ -32,7 +32,10 @@ def executeCommand(command: List[str]) -> int:
|
||||
:return: exit code of executed command
|
||||
"""
|
||||
|
||||
exitCode, stdout, stderr = exec.execute(command)
|
||||
try:
|
||||
exitCode, stdout, stderr = exec.execute(command)
|
||||
except Exception as e:
|
||||
exitCode, stdout, stderr = 1, '', 'Caught subprocess exception: ' + str(e)
|
||||
|
||||
prefix = '┃ '
|
||||
BODY = f'┏{"━" * 19}\n' \
|
||||
|
@ -9,8 +9,9 @@ def execute(command: List[str]):
|
||||
Runs the given command in a subprocess and passes stdin (if given) to that process.
|
||||
Waits for command to complete.
|
||||
|
||||
:param command: A command to executed as list of words, e.g. ['echo', 'Hello world!']
|
||||
:param command: A command to executed as list of words, e.g. `['echo', 'Hello world!']`
|
||||
:return: (exit_code, stdout, stderr)
|
||||
:raises Exception: Might throw an exception.E.g. FileNotFoundError if the executable (first element of `command`) does not exist.
|
||||
"""
|
||||
|
||||
if sys.version_info.major == 3 and sys.version_info.minor < 7:
|
||||
|
Loading…
Reference in New Issue
Block a user