diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2019-03-25 19:26:51 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2019-03-25 19:26:51 -0300 |
commit | 53e30563bd825d21d276b3f9c79e94bb754f642f (patch) | |
tree | adddcc6e926800fd84b03866b8c4b95e66bcfa2c | |
parent | d08a02dc906f5a121e58a37c4c0af9c7cb3938f3 (diff) | |
download | keyringer-53e30563bd825d21d276b3f9c79e94bb754f642f.tar.gz keyringer-53e30563bd825d21d276b3f9c79e94bb754f642f.tar.bz2 |
Fix secret name when encrypting a folder
-rw-r--r-- | ChangeLog | 2 | ||||
-rwxr-xr-x | lib/keyringer/actions/encrypt | 7 |
2 files changed, 8 insertions, 1 deletions
@@ -6,6 +6,8 @@ Fix git parameter expansion + Fix secret name when encrypting a folder + 2019-01-29 - 0.5.4 - Silvio Rhatto <rhatto@riseup.net> Use --no-encrypt-to GnuPG option to strictly respect the recipients file diff --git a/lib/keyringer/actions/encrypt b/lib/keyringer/actions/encrypt index c1d5601..1256374 100755 --- a/lib/keyringer/actions/encrypt +++ b/lib/keyringer/actions/encrypt @@ -95,9 +95,14 @@ if [ "$UNENCRYPTED_FILE" != "-" ] && [ -d "$UNENCRYPTED_FILE" ]; then # Time to go recursive BASEPATH="`basename $FILE .asc`" FILEPATH="`dirname "$UNENCRYPTED_FILE"`" + + if [ "$FILEPATH" == "." ]; then + FILEPATH="$(cd `dirname "$UNENCRYPTED_FILE"` &> /dev/null & pwd)" + fi + find $UNENCRYPTED_FILE | while read file; do if [ ! -d "$file" ]; then - dir="`dirname "$file" | sed -e "s|^$FILEPATH|$BASEPATH|g"`" + dir="`dirname "$file" | sed -e "s|^$UNENCRYPTED_FILE|$BASEPATH|" -e "s|^$FILEPATH|$BASEPATH|"`" keyringer_get_new_file `basename "$file"` keyringer_encrypt "$dir/$FILE" $file fi |