Skip to content

Commit 17a9d09

Browse files
committed
Fixup
1 parent 79fdf84 commit 17a9d09

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

suite/auto-sync/src/autosync/CompareInc.py

+7-12
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ def get_changed_files(base_ref: str, cmp_ref: str) -> list[dict]:
2626
capture_output=True,
2727
)
2828
if result.stderr:
29-
log.fatal(f"git diff failed with: {result.stderr}")
30-
exit(1)
29+
fail_exit(f"git diff failed with: {result.stderr}")
3130

3231
if not result.stdout:
3332
# Nothing changed
@@ -51,9 +50,7 @@ def compare_files(changed_files: list[dict]) -> bool:
5150
in_capstone = (
5251
get_path("{CS_ARCH_MODULE_DIR}").joinpath(f["arch"]).joinpath(f["filename"])
5352
)
54-
generated = (
55-
get_path("{C_INC_OUT_DIR}").joinpath(f["arch"]).joinpath(f["filename"])
56-
)
53+
generated = get_path("{C_INC_OUT_DIR}").joinpath(f["filename"])
5754
if not in_capstone.exists():
5855
log.error(f"{in_capstone} does not exist.")
5956
success = False
@@ -99,13 +96,11 @@ def main():
9996
force=True,
10097
)
10198
changed_files = get_changed_files(args.base_ref, args.cmp_ref)
102-
print(changed_files)
103-
if not compare_files(changed_files):
104-
log.error("Some files were not correctly generated.")
105-
exit(1)
106-
log.error("Files were correctly generated.")
107-
log.error("\n\nIf you did not change anything: please notify us.\n\n")
108-
exit(0)
99+
if compare_files(changed_files):
100+
log.info("Files were correctly generated.")
101+
exit(0)
102+
log.error("If you did not change anything: please notify us.")
103+
fail_exit("Some files were not correctly generated.")
109104

110105

111106
if __name__ == "__main__":

0 commit comments

Comments
 (0)