verify a tiddlywiki.info exists after chdir into wiki folder

This commit is contained in:
Soren I. Bjornstad 2021-08-26 11:08:53 -05:00
parent a48f527ec8
commit ba8f7d6df1
1 changed files with 7 additions and 2 deletions

9
tzk.py
View File

@ -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)