From 0c7fa3d71458363598b2cafc47a26daef3a3f147 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Thu, 21 Sep 2023 09:40:56 +0200 Subject: [PATCH] feat(py): keep a local timestamped copy of edited note before sending to server --- cli/app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cli/app.py b/cli/app.py index 24bc301..cb5ff37 100644 --- a/cli/app.py +++ b/cli/app.py @@ -48,6 +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(settings["commands"]["diff"] + ["data/" + filename(note) + ".bak", "data/" + filename(note)]) note["content"] = newcontent data.remove(note)