mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 08:38:32 +02:00
Change default config to use journal key instead of journal name as key for file path (#1594)
This commit is contained in:
parent
dd7f59cef7
commit
ceff398a01
3 changed files with 4 additions and 4 deletions
|
@ -91,7 +91,7 @@ def get_config_path():
|
||||||
def get_default_config():
|
def get_default_config():
|
||||||
return {
|
return {
|
||||||
"version": __version__,
|
"version": __version__,
|
||||||
"journals": {"default": get_default_journal_path()},
|
"journals": {"default": {"journal": get_default_journal_path()}},
|
||||||
"editor": os.getenv("VISUAL") or os.getenv("EDITOR") or "",
|
"editor": os.getenv("VISUAL") or os.getenv("EDITOR") or "",
|
||||||
"encrypt": False,
|
"encrypt": False,
|
||||||
"template": False,
|
"template": False,
|
||||||
|
|
|
@ -122,10 +122,10 @@ def install():
|
||||||
)
|
)
|
||||||
journal_path = absolute_path(user_given_path or default_journal_path)
|
journal_path = absolute_path(user_given_path or default_journal_path)
|
||||||
default_config = get_default_config()
|
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
|
# 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:
|
try:
|
||||||
os.makedirs(path)
|
os.makedirs(path)
|
||||||
except OSError:
|
except OSError:
|
||||||
|
|
|
@ -118,7 +118,7 @@ def output_should_be_columns_wide(cli_run, width):
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
def default_journal_location(journal_file, journal_dir, config_on_disk, temp_dir):
|
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 = (
|
expected_journal_path = (
|
||||||
os.path.join(temp_dir.name, journal_file)
|
os.path.join(temp_dir.name, journal_file)
|
||||||
if journal_dir == "."
|
if journal_dir == "."
|
||||||
|
|
Loading…
Add table
Reference in a new issue