Skip to content

Commit

Permalink
Set check flag to True
Browse files Browse the repository at this point in the history
  • Loading branch information
deepsource-autofix[bot] authored and Freed-Wu committed Jan 23, 2023
1 parent c559b5e commit 41fe780
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/translate_shell/utils/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def process_shell(text: str, char: str = "!") -> str:
if tokens == []:
tokens = os.getenv("SHELL", "sh")
try:
run(tokens)
run(tokens, check=True)
except Exception as e:
logger.error(e)
return ""
Expand Down
6 changes: 3 additions & 3 deletions src/translate_shell/utils/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ def process_output(translation: Translation) -> str:
# https://github.com/YuriyLisovskiy/pynotifier/issues/21
text = PAT.sub("", rst)
if which("termux-toast"):
run(split("termux-toast -g top") + [text])
run(split("termux-toast -g top") + [text], check=True)
if which("termux-notification"):
run(
split(
f"termux-notification -t Translation --group {APPNAME} "
f"--icon {ICON_FILE} -c"
)
+ [text]
)
+ [text],
check=True)
Notification("Translation", text, 10, "low", ICON_FILE, APPNAME).send()
return rst

0 comments on commit 41fe780

Please sign in to comment.