From 4759a178831bf003e2c962928be11db30feb8795 Mon Sep 17 00:00:00 2001 From: "rhatto@riseup.net" Date: Thu, 17 Apr 2014 17:55:22 -0300 Subject: Rollback: use find+grep instead of 'find -iname' (#53) --- ChangeLog | 2 ++ lib/keyringer/actions/find | 2 +- lib/keyringer/functions | 2 +- 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 + 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:" -- cgit v1.2.3