From 8d17c6cfae3cf8ebb07ba2a1f900a8b69648f9a2 Mon Sep 17 00:00:00 2001 From: Micah Jerome Ellison Date: Sat, 10 Sep 2022 14:34:41 -0700 Subject: [PATCH] Change default config to use journal key instead of journal name as key for file path --- jrnl/config.py | 2 +- jrnl/install.py | 4 ++-- tests/lib/then_steps.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/jrnl/config.py b/jrnl/config.py index bdcc86ab..863ab42c 100644 --- a/jrnl/config.py +++ b/jrnl/config.py @@ -91,7 +91,7 @@ def get_config_path(): def get_default_config(): return { "version": __version__, - "journals": {"default": get_default_journal_path()}, + "journals": {"default": {"journal": get_default_journal_path()}}, "editor": os.getenv("VISUAL") or os.getenv("EDITOR") or "", "encrypt": False, "template": False, diff --git a/jrnl/install.py b/jrnl/install.py index a4797dc7..b20685f0 100644 --- a/jrnl/install.py +++ b/jrnl/install.py @@ -122,10 +122,10 @@ def install(): ) journal_path = absolute_path(user_given_path or default_journal_path) default_config = get_default_config() - default_config["journals"][DEFAULT_JOURNAL_KEY] = journal_path + default_config["journals"][DEFAULT_JOURNAL_KEY]["journal"] = journal_path # If the folder doesn't exist, create it - path = os.path.split(default_config["journals"][DEFAULT_JOURNAL_KEY])[0] + path = os.path.split(journal_path)[0] try: os.makedirs(path) except OSError: diff --git a/tests/lib/then_steps.py b/tests/lib/then_steps.py index 28bc41cf..c2741212 100644 --- a/tests/lib/then_steps.py +++ b/tests/lib/then_steps.py @@ -117,7 +117,7 @@ def output_should_be_columns_wide(cli_run, width): ) ) def default_journal_location(journal_file, journal_dir, config_on_disk, temp_dir): - default_journal_path = config_on_disk["journals"]["default"] + default_journal_path = config_on_disk["journals"]["default"]["journal"] expected_journal_path = ( os.path.join(temp_dir.name, journal_file) if journal_dir == "."