about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2020-08-27 14:53:58 +0530
committerAndinus <andinus@nand.sh>2020-08-27 14:53:58 +0530
commiteeb6cb006e4053bf56658ccaadde5ba17933f8d9 (patch)
tree97cfad3e60bdf6ce3656826588bf278ef235cf54
parent61e44ee71deaa01a23866cf069df4ceaa0bf4446 (diff)
downloadleo-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-xleo.pl5
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};