summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rwxr-xr-xlib/keyringer/actions/encrypt7
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 10da2b2..f503212 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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