aboutsummaryrefslogtreecommitdiff
path: root/lib/keyringer/actions/encrypt
diff options
context:
space:
mode:
Diffstat (limited to 'lib/keyringer/actions/encrypt')
-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