Commit f553cd88 authored by Nils Cedric Holle's avatar Nils Cedric Holle

Catch git errors

Fixes #116
parent 6942527a
This diff is collapsed.
......@@ -726,9 +726,14 @@ class PSManager(QtCore.QObject):
try:
self.__repo = git.Repo(path)
except Exception as e:
git.Repo.init(path)
self.__repo = git.Repo(path)
initial = True
try:
git.Repo.init(path)
self.__repo = git.Repo(path)
initial = True
except Exception as e:
print(e)
notificationsystem.newNotification(
translate("Manager", "Git error:") + " " + str(e))
if ".gitignore" not in os.listdir(path):
with open(os.path.join(path, ".gitignore"), "w") as f:
......@@ -738,8 +743,13 @@ class PSManager(QtCore.QObject):
initial = True
if initial:
self.__repo.git.add(".")
self.__repo.index.commit("Initial commit")
try:
self.__repo.git.add(".")
self.__repo.index.commit("Initial commit")
except Exception as e:
print(e)
notificationsystem.newNotification(
translate("Manager", "Git error:") + " " + str(e))
def __savePuzzle(self, path: str):
self.config.save()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment