mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-29 22:16:13 +02:00
Give a proper message when trying to use an empty config file (#1461)
* Added check for empty config file and if so, use default config * Added check for empty config file and if so, use default config * Fix and add tests for empty config file * Exit program with message if config is empty. bdd-test doesn't add version if file is (and should stay) empty. * Exit program with message if config is empty. * bdd-test doesn't add version if file is (and should stay) empty. Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
This commit is contained in:
parent
71c1d38d50
commit
792f188ecc
4 changed files with 20 additions and 2 deletions
|
@ -75,6 +75,10 @@ def load_or_install_jrnl(alt_config_path):
|
|||
logging.debug("Reading configuration from file %s", config_path)
|
||||
config = load_config(config_path)
|
||||
|
||||
if config is None:
|
||||
print("Unable to parse config file", file=sys.stderr)
|
||||
sys.exit()
|
||||
|
||||
if is_old_version(config_path):
|
||||
from jrnl import upgrade
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue