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
This commit is contained in:
Debanjum Singh Solanky 2022-09-09 07:15:28 +03:00
parent 79894efc7a
commit 3ddffdfba4

View file

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