Skip to content

Commit

Permalink
adjust c.py
Browse files Browse the repository at this point in the history
  • Loading branch information
be-great committed Nov 27, 2023
1 parent 8fc5df1 commit 0fb6409
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion alxcheck/checks/c.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
import subprocess
from ..utils.error_logging import print_please_install_betty


def betty_check(file_path):
try:
result = subprocess.run(["betty", file_path])
except Exception:
print_please_install_betty()
return False
# because it have different ouput meaning looking for errors
try:
result1 = subprocess.run(["betty", file_path], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
except subprocess.CalledProcessError as e:
return False

if "ERROR:" in result1.stdout or "ERROR:" in result1.stderr:
return False

return result.returncode == 0

0 comments on commit 0fb6409

Please sign in to comment.