1
0
mirror of https://github.com/chubin/cheat.sh.git synced 2026-06-20 13:16:44 +02:00

Print full cmd when bash is not found

This commit is contained in:
Anatoli Babenia
2020-07-29 10:49:21 +03:00
parent c9a959f087
commit dd00fa4188
+6 -3
View File
@@ -75,9 +75,12 @@ def _render_html(query, result, editable, repository_button, topics_list, reques
"""
Convert ANSI text `data` to HTML
"""
proc = Popen(
["bash", CONFIG['path.internal.ansi2html'], "--palette=solarized", "--bg=dark"],
stdin=PIPE, stdout=PIPE, stderr=PIPE)
cmd = ["bash", CONFIG['path.internal.ansi2html'], "--palette=solarized", "--bg=dark"]
try:
proc = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
except FileNotFoundError:
print("ERROR: %s" % cmd)
raise
data = data.encode('utf-8')
stdout, stderr = proc.communicate(data)
if proc.returncode != 0: