Handle creating new files

master
Daniel Berteaud 6 years ago
parent 26d42b7ac6
commit e475e1de3c
  1. 3
      bin/var_editor.py

@ -29,7 +29,8 @@ def main():
f = Fernet(key)
# This temp file will hold the decrypted content while we edit it
tmp = tempfile.NamedTemporaryFile()
# We open the file, which contains the encrypted content
# We open the file which contains the encrypted content, if it exists
if os.path.exists(args[0]):
crypt = open(args[0], 'rb').read()
# And we decrypt it, and write it in the temp file
clear = f.decrypt(crypt)

Loading…
Cancel
Save