mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-07-13 10:16:12 +02:00
Upgrade scaffolding
This commit is contained in:
parent
09b94d1047
commit
51a6ac2d51
3 changed files with 30 additions and 9 deletions
17
jrnl/upgrade.py
Normal file
17
jrnl/upgrade.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
def upgrade_jrnl_if_necessary(config_path):
|
||||
with open(config_path) as f:
|
||||
config = f.read()
|
||||
if not config.strip().startswith("{"):
|
||||
return
|
||||
|
||||
util.prompt("Welcome to jrnl {}".format(__version__))
|
||||
util.prompt("jrnl will now upgrade your configuration and journal files.")
|
||||
util.prompt("Please note that jrnl 1.x is NOT forward compatible with this version of jrnl.")
|
||||
util.prompt("If you choose to proceed, you will not be able to use your journals with")
|
||||
util.prompt("older versions of jrnl anymore.")
|
||||
cont = util.yesno("Continue upgrading jrnl?", default=False)
|
||||
if not cont:
|
||||
util.prompt("jrnl NOT upgraded, exiting.")
|
||||
sys.exit(1)
|
||||
|
||||
util.prompt("")
|
Loading…
Add table
Add a link
Reference in a new issue