From ac1227b4ea0c533242cb0652cf4423e96751dd13 Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Thu, 28 Apr 2022 14:27:01 +0100 Subject: [PATCH] fix: limit find commands to files only --- calliope.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/calliope.sh b/calliope.sh index a4e2ad8..1b440f4 100755 --- a/calliope.sh +++ b/calliope.sh @@ -225,7 +225,7 @@ encrypt_all () echo "Encryption is not enabled" else echo "Encrypting all files with $encryptionId" - find pdfs/ diary/ -execdir $GPG_COMMAND --encrypt --sign -r "$encryptionId" "{}" \; + find pdfs/ diary/ -type f -and -not -type l -execdir $GPG_COMMAND --encrypt --sign -r "$encryptionId" "{}" \; fi } @@ -419,7 +419,7 @@ remove_unencrpyted () echo "Encryption is not enabled" else echo "Deleting all unencrpyted files" - find pdfs/ diary/ -not -name "*.gpg" -delete + find pdfs/ diary/ -not -name "*.gpg" -and -type f -and -not -type l -delete fi }