about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2020-08-27 15:07:04 +0530
committerAndinus <andinus@nand.sh>2020-08-27 15:07:04 +0530
commit252af66a78927f8e10e07f7e289ba1b2f968a8a8 (patch)
tree17083bc22e8a0d4ef50a441f499d69bae4207917
parent42b3e462cb676dafa469b393c1b60211e69f91d4 (diff)
downloadleo-252af66a78927f8e10e07f7e289ba1b2f968a8a8.tar.gz
Print Encrypted/Signed status , don't encrypt journal
My journal is already encrypted so don't encrypt it again.
-rwxr-xr-xleo.pl8
1 files changed, 7 insertions, 1 deletions
diff --git a/leo.pl b/leo.pl
index f2361f4..8fb200c 100755
--- a/leo.pl
+++ b/leo.pl
@@ -25,9 +25,12 @@ my %dispatch = (
                 "-C", "$ENV{HOME}/documents", ".");
     },
     "journal" => sub {
+        my $tmp = $options{encrypt} and undef $options{encrypt}
+            if $options{encrypt};
         archive("$archive_dir/journal_$ymd.tar",
                 "-C", "$ENV{HOME}/documents",
                 "andinus.org.gpg", "archive.org.gpg");
+        $options{encrypt} = $tmp;
     },
     "ssh" => sub {
         archive("$archive_dir/ssh_$ymd.tar",
@@ -89,7 +92,10 @@ sub encrypt_sign() {
 
     $? # We assume non-zero is an error.
         ? die "Encrypt/Sign failed :: $?\n"
-        : say "\nOutput: $file.gpg";
+        : print "\nOutput: $file.gpg";
+    print " [Encrypted]" if $options{encrypt};
+    print " [Signed]" if $options{sign};
+    print "\n";
 
     unlink $file and say "$file deleted."
         or warn "[WARN] Could not delete $file: $!\n"