Skip to content

Commit

Permalink
fix: limit find commands to files only
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjayankur31 committed Apr 28, 2022
1 parent 4f15984 commit ac1227b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions calliope.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit ac1227b

Please sign in to comment.