From ba8f7d6df13d75d87cee3b058ade86e6f8270e26 Mon Sep 17 00:00:00 2001 From: "Soren I. Bjornstad" Date: Thu, 26 Aug 2021 11:08:53 -0500 Subject: [PATCH] verify a tiddlywiki.info exists after chdir into wiki folder --- tzk.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tzk.py b/tzk.py index 66e467d..a27c014 100644 --- a/tzk.py +++ b/tzk.py @@ -166,7 +166,12 @@ if not args._cls.cmd == "init": os.chdir(cm.wiki_folder) except FileNotFoundError: fail(f"Tried to change directory into the wiki_folder '{cm.wiki_folder}' " - f"specified in your config file, but that directory does not exist.") - # TODO: confirm we're in the right directory + f"specified in your config file, but that directory does not exist.") + + if not os.path.exists("tiddlywiki.info"): + fail(f"After changing directory into {cm.wiki_folder} per your config file: " + f"Expected a 'tiddlywiki.info' file in {os.getcwd()}. " + f"Please check that your wiki is initialized " + f"and you specified the correct wiki_folder_name.") args._cls().execute(args)