diff --git a/python/mocha-shell.py b/python/mocha-shell.py index 2467e0a..46c460d 100644 --- a/python/mocha-shell.py +++ b/python/mocha-shell.py @@ -30,7 +30,12 @@ import sys from colorama import Fore, Style from getpass import getpass -histfile = os.path.join(os.path.expanduser("~"), ".config/latte/history") +configpath = os.path.join(os.path.expanduser("~"), ".config", "latte") +if not os.path.exists(configpath): + os.mkdir(configpath) + +histfile = os.path.join(configpath, "history") + try: readline.read_history_file(histfile) # default history len is -1 (infinite), which may grow unruly