summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2023-12-27 11:02:25 +0200
committerLars Wirzenius <liw@liw.fi>2023-12-27 11:02:25 +0200
commiteb79c2c6cd7d57b3a278f12f320813f726cc5ff2 (patch)
tree40daa202588a6a9dfc0884249b1abd4a3b077946
parent8b72f256e96f69c88e6f9a2dd8a15fbc184f4b2a (diff)
downloadwumpus-hunter-eb79c2c6cd7d57b3a278f12f320813f726cc5ff2.tar.gz
feat: remove log on success
Signed-off-by: Lars Wirzenius <liw@liw.fi>
-rwxr-xr-xwumpus-hunter7
1 files changed, 6 insertions, 1 deletions
diff --git a/wumpus-hunter b/wumpus-hunter
index 34eb5b7..862dde0 100755
--- a/wumpus-hunter
+++ b/wumpus-hunter
@@ -159,6 +159,10 @@ def record(filename, commit, result):
f.write(f"{commit} {result}\n")
+def remove_log(log):
+ os.remove(log)
+
+
def rename_log(log, dirname, commit):
commit_dir = os.path.join(dirname, f"log-{commit}")
if not os.path.exists(commit_dir):
@@ -200,10 +204,11 @@ def main():
build(args.dir)
run_tests(args.dir, args.test)
record_success(args.stats, commit)
+ remove_log(args.log)
except Exception as e:
logging.error(f"{e}", exc_info=True)
record_failure(args.stats, commit)
- rename_log(args.log, args.run_log, commit)
+ rename_log(args.log, args.run_log, commit)
if args.counts:
count(args.counts, args.stats)