From e380c8a355b4340c26dc51c6be7bed78f87b0c71 Mon Sep 17 00:00:00 2001 From: Blake Miner Date: Wed, 6 Nov 2024 17:08:08 -0500 Subject: [PATCH] Fixed bug where find_in globs were matching directories (#980) --- sourced/cool-oneliners/find_in.nu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sourced/cool-oneliners/find_in.nu b/sourced/cool-oneliners/find_in.nu index 4f8dc50..20855ed 100644 --- a/sourced/cool-oneliners/find_in.nu +++ b/sourced/cool-oneliners/find_in.nu @@ -3,10 +3,10 @@ def "find in" [ glob: glob, # the glob expression ...rest: any # terms to search ]: nothing -> table { - glob $glob + glob --no-dir $glob | par-each {|e| open $e | lines | enumerate | rename line data | - find -c [data] ...$rest | + find --columns [data] ...$rest | each {|match| {path: ($e | path relative-to $env.PWD), ...$match}} } | flatten }