summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2019-03-25 19:26:51 -0300
committerSilvio Rhatto <rhatto@riseup.net>2019-03-25 19:26:51 -0300
commit53e30563bd825d21d276b3f9c79e94bb754f642f (patch)
treeadddcc6e926800fd84b03866b8c4b95e66bcfa2c /lib
parentd08a02dc906f5a121e58a37c4c0af9c7cb3938f3 (diff)
downloadkeyringer-53e30563bd825d21d276b3f9c79e94bb754f642f.tar.gz
keyringer-53e30563bd825d21d276b3f9c79e94bb754f642f.tar.bz2
Fix secret name when encrypting a folder
Diffstat (limited to 'lib')
-rwxr-xr-xlib/keyringer/actions/encrypt7
1 files changed, 6 insertions, 1 deletions
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