make config dir if it doesn't already exist

This commit is contained in:
Michael Becker 2024-03-21 21:42:27 -04:00
parent d03954b91a
commit f713375a91

View File

@ -30,7 +30,12 @@ import sys
from colorama import Fore, Style from colorama import Fore, Style
from getpass import getpass 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: try:
readline.read_history_file(histfile) readline.read_history_file(histfile)
# default history len is -1 (infinite), which may grow unruly # default history len is -1 (infinite), which may grow unruly