don't crash if tzk is used without arguments

This commit is contained in:
Soren I. Bjornstad 2022-01-23 17:22:45 -06:00
parent 35ca2b896e
commit 4a6e4e7bc0

View File

@ -385,6 +385,7 @@ def launch():
# go there before doing anything else. # go there before doing anything else.
if (not os.path.exists("tzk_config.py") if (not os.path.exists("tzk_config.py")
and os.environ.get('TZK_DIRECTORY') and os.environ.get('TZK_DIRECTORY')
and len(sys.argv) > 1
and sys.argv[1] != "init"): # we can't init an existing TZK_DIRECTORY and sys.argv[1] != "init"): # we can't init an existing TZK_DIRECTORY
try: try:
os.chdir(os.environ['TZK_DIRECTORY']) os.chdir(os.environ['TZK_DIRECTORY'])