]> gitweb.fluxo.info Git - keyringer.git/commitdiff
Rollback: use find+grep instead of 'find -iname' (#53)
authorrhatto@riseup.net <Silvio Rhatto>
Thu, 17 Apr 2014 20:55:22 +0000 (17:55 -0300)
committerrhatto@riseup.net <Silvio Rhatto>
Thu, 17 Apr 2014 20:55:22 +0000 (17:55 -0300)
ChangeLog
lib/keyringer/actions/find
lib/keyringer/functions

index 742307cf2057dbebe82dbdb028460c34e467fd0d..c068f9c5d739d9aa7843f2c226f951580494a160 100644 (file)
--- 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
index 21afc7a7096f392297c2f71d45f1ec8a1d12cbd5..9b18d66891ab7190054dda76ee6925b10eb30bb8 100755 (executable)
@@ -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"
index ad18f448951cd9dd9aef5f86fb01e5e07c6251e0..59777d0be8ec14e7df9d6d1c3bd9be0f07740e1d 100755 (executable)
@@ -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:"