Skip to content

Commit

Permalink
fix: do not try to decrypt unencrypted files
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjayankur31 committed Apr 28, 2022
1 parent 4b765fa commit 4503fce
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions calliope.sh
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,15 @@ decrypt ()
then
if [ -f "$1" ]
then
echo "Decrypting $1 with $encryptionId"
nongpgfname="$(basename $1 .gpg)"
$GPG_COMMAND --decrypt $1 > "$nongpgfname"
if [ "${1: -4}" == ".gpg" ]
then
echo "Decrypting $1 with $encryptionId"
nongpgfname="$(basename $1 .gpg)"
$GPG_COMMAND --decrypt $1 > "$nongpgfname"

else
echo "File is not a GPG encrypted file. Doing nothing."
fi
else
echo "File $1 not found"
exit 1
Expand Down

0 comments on commit 4503fce

Please sign in to comment.