moss

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit f6b7eb29e46a107178b41ca9e55550d3ea8d4026
parent 425b09955db514f63ab6d1f68394c832e345f935
Author: Daniel Barlow <dan@telent.net>
Date:   Mon,  9 Aug 2021 00:25:21 +0100

search for secret names not leading pathname components

Diffstat:
Mrjpass.rb | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/rjpass.rb b/rjpass.rb @@ -65,10 +65,14 @@ when 'edit' end end when 'search' - files = Dir[STORE.join('**/*.age')].filter {|f| f.match(Regexp.new(term)) } term = parameters.join(" ") + files = Dir[STORE.join('**/*.age')].map {|n| + Pathname.new(n).relative_path_from(STORE).sub_ext('').to_s + }.filter {|f| + f.match(Regexp.new(term)) + } files.each do |n| - puts Pathname.new(n).relative_path_from(STORE).sub_ext('') + puts n end else raise "command #{action} unrecognized"