From afefa8dcf0ec3a7d97bd3a364675011215cdaf28 Mon Sep 17 00:00:00 2001 From: Stefan Harmuth Date: Wed, 29 Dec 2021 12:27:50 +0100 Subject: [PATCH] use git if available --- tools/aoc.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/aoc.py b/tools/aoc.py index daecc9f..d8d3ced 100644 --- a/tools/aoc.py +++ b/tools/aoc.py @@ -1,5 +1,7 @@ import os import re +import subprocess + import requests import time import webbrowser @@ -91,6 +93,9 @@ class AOCDay: f.write(response.content) f.flush() + if os.path.exists(".git"): + subprocess.call(["git", "add", filename]) + def _submit(self, part: int, answer: Any): answer_cache = JSONFile("answer_cache.json", create=True) str_day = str(self.day)