diff options
author | Andinus <andinus@nand.sh> | 2020-08-27 14:53:58 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2020-08-27 14:53:58 +0530 |
commit | eeb6cb006e4053bf56658ccaadde5ba17933f8d9 (patch) | |
tree | 97cfad3e60bdf6ce3656826588bf278ef235cf54 | |
parent | 61e44ee71deaa01a23866cf069df4ceaa0bf4446 (diff) | |
download | leo-eeb6cb006e4053bf56658ccaadde5ba17933f8d9.tar.gz |
Push receipient only when encrypt option is passed
Fixes this error: gpg: WARNING: recipients (-r) given without using public key encryption
-rwxr-xr-x | leo.pl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/leo.pl b/leo.pl index 9d14e9d..a2656a4 100755 --- a/leo.pl +++ b/leo.pl @@ -76,8 +76,9 @@ sub archive { # Encrypt, Sign archives. sub encrypt_sign() { my $file = shift @_; - my @options = ("--recipient", $gpg_fingerprint); - push @options, "--encrypt" if $options{encrypt}; + my @options = (); + push @options, "--recipient", $gpg_fingerprint, "--encrypt" + if $options{encrypt}; push @options, "--sign" if $options{sign}; push @options, "--verbose" if $options{verbose}; |