determine OS to correctly save journal file and to switch back to one-branch development for convenience

This commit is contained in:
julian 2024-03-21 16:50:07 +01:00
parent 4620116b89
commit 89f8a1362a

View File

@ -11,7 +11,13 @@ YEAR = now.strftime("%Y")
MONTH = now.strftime("%m")
DAY = now.strftime("%d")
journal_filename = "%s-%s-%s-Journal.txt" % (YEAR, MONTH, DAY)
journal_filename_path = "./%s" % journal_filename
# determine OS to correctly save journal file and to switch back to one-branch development for convenience
if os.name == 'posix':
journal_filename_path = "./%s" % journal_filename
if os.name == 'nt':
journal_filename_path = "$Env:AppData/%s" % journal_filename
if not os.path.exists(journal_filename_path):
with open(journal_filename_path, "w"):