use git if available

This commit is contained in:
Stefan Harmuth 2021-12-29 12:27:50 +01:00
parent 5e3bf28e7e
commit afefa8dcf0

View File

@ -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)