From eeb6cb006e4053bf56658ccaadde5ba17933f8d9 Mon Sep 17 00:00:00 2001 From: Andinus Date: Thu, 27 Aug 2020 14:53:58 +0530 Subject: Push receipient only when encrypt option is passed Fixes this error: gpg: WARNING: recipients (-r) given without using public key encryption --- leo.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'leo.pl') 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}; -- cgit 1.4.1-2-gfad0