aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhatto@riseup.net <Silvio Rhatto>2014-04-17 17:55:22 -0300
committerrhatto@riseup.net <Silvio Rhatto>2014-04-17 17:55:22 -0300
commit4759a178831bf003e2c962928be11db30feb8795 (patch)
treebd98ea49b6d041ec4e1f02983e2d4ddc920f9701
parent7aa135d606c036ab41d1671b484bb80c11b0442f (diff)
downloadkeyringer-4759a178831bf003e2c962928be11db30feb8795.tar.gz
keyringer-4759a178831bf003e2c962928be11db30feb8795.tar.bz2
Rollback: use find+grep instead of 'find -iname' (#53)
-rw-r--r--ChangeLog2
-rwxr-xr-xlib/keyringer/actions/find2
-rwxr-xr-xlib/keyringer/functions2
3 files changed, 4 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 742307c..c068f9c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2014-04-11 - Silvio Rhatto <rhatto@riseup.net>
+ Find: rollback: use find+grep instead of 'find -iname' (#53)
+
Edit/open: wait for background process to finish (#49)
Edit: use encrypt action
diff --git a/lib/keyringer/actions/find b/lib/keyringer/actions/find
index 21afc7a..9b18d66 100755
--- a/lib/keyringer/actions/find
+++ b/lib/keyringer/actions/find
@@ -15,5 +15,5 @@ shift
ARGS="`echo "$*" | sed -e "s|^/*||"`"
# Run find command
-cd "$KEYDIR/$RELATIVE_PATH" && find -iname "*$ARGS*" | sed -e 's|^./||g'
+cd "$KEYDIR/$RELATIVE_PATH" && find | grep -i "$ARGS" | sed -e 's|^./||g'
cd "$CWD"
diff --git a/lib/keyringer/functions b/lib/keyringer/functions
index ad18f44..59777d0 100755
--- a/lib/keyringer/functions
+++ b/lib/keyringer/functions
@@ -436,7 +436,7 @@ function keyringer_get_file {
elif [ ! -f "$KEYDIR/$FILE" ]; then
# Try to find a similar file
count=0
- candidates=(`keyringer_exec find "$BASEDIR" "$1*.asc"`)
+ candidates=(`keyringer_exec find "$BASEDIR" | grep -i "$1" | grep -e '.asc$'`)
if [ ! -z "$candidates" ]; then
echo "Could not find exact match for \"$1\", please choose one of the following secrets:"