mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
Expand vars and user tilde for upgrade backup
This commit is contained in:
parent
452d99f835
commit
9f7d71aa8f
1 changed files with 1 additions and 0 deletions
|
@ -10,6 +10,7 @@ import os
|
|||
|
||||
def backup(filename, binary=False):
|
||||
util.prompt(" Created a backup at {}.backup".format(filename))
|
||||
filename = os.path.expanduser(os.path.expandvars(filename))
|
||||
with open(filename, 'rb' if binary else 'r') as original:
|
||||
contents = original.read()
|
||||
with open(filename + ".backup", 'wb' if binary else 'w') as backup:
|
||||
|
|
Loading…
Add table
Reference in a new issue