mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-28 21:46:13 +02:00
Warn when DayOne/directory journals have encrypt: true in config (#1325)
* Raise exception when trying to commit folder-based journal (including DayOne) * Change negative bool name to a positive * Add test to ensure this doesn't mess with encrypting normal journals * Consolidate and standardized tests * Add failing test for new error message about unencryptable journals * Warn when encrypt is true and journal type is directory/DayOne
This commit is contained in:
parent
c52e878c01
commit
fa146b1434
2 changed files with 15 additions and 2 deletions
|
@ -407,6 +407,12 @@ def open_journal(journal_name, config, legacy=False):
|
|||
config["journal"] = os.path.expanduser(os.path.expandvars(config["journal"]))
|
||||
|
||||
if os.path.isdir(config["journal"]):
|
||||
if config["encrypt"]:
|
||||
print(
|
||||
"Warning: This journal's config has 'encrypt' set to true, but this type of journal can't be encrypted.",
|
||||
file=sys.stderr,
|
||||
)
|
||||
|
||||
if config["journal"].strip("/").endswith(".dayone") or "entries" in os.listdir(
|
||||
config["journal"]
|
||||
):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue