mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
Allows multiple journals to override default configuration
This commit is contained in:
parent
8948c6b23b
commit
db8e10c5f2
1 changed files with 5 additions and 2 deletions
|
@ -146,8 +146,11 @@ def cli():
|
||||||
journal_name = args.text[0] if (args.text and args.text[0] in config['journals']) else 'default'
|
journal_name = args.text[0] if (args.text and args.text[0] in config['journals']) else 'default'
|
||||||
if journal_name is not 'default':
|
if journal_name is not 'default':
|
||||||
args.text = args.text[1:]
|
args.text = args.text[1:]
|
||||||
config['journal'] = config['journals'].get(journal_name)
|
journal_conf = config['journals'].get(journal_name)
|
||||||
|
if type(journal_conf) is dict: # We can override the default config on a by-journal basis
|
||||||
|
config.update(journal_conf)
|
||||||
|
else: # But also just give them a string to point to the journal file
|
||||||
|
config['journal'] = journal_conf
|
||||||
touch_journal(config['journal'])
|
touch_journal(config['journal'])
|
||||||
mode_compose, mode_export = guess_mode(args, config)
|
mode_compose, mode_export = guess_mode(args, config)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue