From 3ddffdfba4fb20684953fcb41352771e0d46a015 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Fri, 9 Sep 2022 07:15:28 +0300 Subject: [PATCH] Create config directory before setting up logging to file under it - The logging to file code expects the config directory to already be setup - But parent directory of config file was being set up later in code - This resulted in app start failing with ~/.khoj dir does not exist error --- src/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.py b/src/main.py index 72a05884..6fbcd035 100644 --- a/src/main.py +++ b/src/main.py @@ -63,6 +63,9 @@ def run(): args = cli(state.cli_args) set_state(args) + # Create app directory, if it doesn't exist + state.config_file.parent.mkdir(parents=True, exist_ok=True) + # Setup Logger if args.verbose == 0: logger.setLevel(logging.WARN)