mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
Detectsa DayOne journals that are stored in the Mobile Documents folder
This commit is contained in:
parent
d50e55480a
commit
c849b03c5c
1 changed files with 7 additions and 4 deletions
11
jrnl/jrnl.py
11
jrnl/jrnl.py
|
@ -150,13 +150,16 @@ def cli(manual_args=None):
|
|||
mode_compose, mode_export = guess_mode(args, config)
|
||||
|
||||
# open journal file or folder
|
||||
if os.path.isdir(config['journal']) and ( config['journal'].endswith(".dayone") or \
|
||||
config['journal'].endswith(".dayone/")):
|
||||
journal = Journal.DayOne(**config)
|
||||
if os.path.isdir(config['journal']):
|
||||
if config['journal'].strip("/").endswith(".dayone") or \
|
||||
"entries" in os.listdir(config['journal']):
|
||||
journal = Journal.DayOne(**config)
|
||||
else:
|
||||
util.prompt("[Error: {} is a directory, but doesn't seem to be a DayOne journal either.".format(config['journal']))
|
||||
sys.exit(-1)
|
||||
else:
|
||||
journal = Journal.Journal(**config)
|
||||
|
||||
|
||||
if mode_compose and not args.text:
|
||||
if config['editor']:
|
||||
raw = get_text_from_editor(config)
|
||||
|
|
Loading…
Add table
Reference in a new issue