From 8bf3a8a140e298574dc6c2b5ae0333852ed0fdec Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Thu, 21 Sep 2023 10:23:15 +0200 Subject: [PATCH] feat(py): dedicated history folder --- cli/app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/app.py b/cli/app.py index cb5ff37..86b332f 100644 --- a/cli/app.py +++ b/cli/app.py @@ -48,7 +48,7 @@ def editnote(note): newcontent = readtextfile("data/" + filename(note) ) if newcontent != content: - subprocess.call(["cp", "data/" + filename(note), "data/" + filename(note) + str(time.time())]) + subprocess.call(["cp", "data/" + filename(note), "history/" + filename(note) + str(time.time())]) subprocess.call(settings["commands"]["diff"] + ["data/" + filename(note) + ".bak", "data/" + filename(note)]) note["content"] = newcontent data.remove(note) @@ -88,6 +88,8 @@ def ask(question): def initdatapath(): if not os.path.exists("data"): os.mkdir("data") + if not os.path.exists("history"): + os.mkdir("history") if os.path.isfile("data/data.acs.bak"): os.remove("data/data.acs.bak")