make script runnable without installation

This commit is contained in:
q
2024-06-26 11:01:53 +03:00
parent 34c5232f03
commit 088f1d2b31

View File

@@ -129,8 +129,7 @@ Usage
) )
parser.add_argument("--name", help="Name of the owner of the key", required=False, default="recipient@address") parser.add_argument("--name", help="Name of the owner of the key", required=False, default="recipient@address")
parser.add_argument( parser.add_argument(
"-r", "--recursive","-r",
"--recursive",
default=False, default=False,
action="store_true", action="store_true",
help="Recursive encryption or decryption. Processes full folder structures", help="Recursive encryption or decryption. Processes full folder structures",
@@ -277,6 +276,8 @@ class Processor:
d = self.gpg.decrypt_file(fp, passphrase=self.phrase, always_trust=True) d = self.gpg.decrypt_file(fp, passphrase=self.phrase, always_trust=True)
if not d.ok: if not d.ok:
print(d.status, file=sys.stderr) print(d.status, file=sys.stderr)
if os.path.exists(out_file):
os.unlink(out_file)
except KeyboardInterrupt: except KeyboardInterrupt:
if os.path.exists(out_file): if os.path.exists(out_file):
os.unlink(out_file) os.unlink(out_file)