16 lines
340 B
Nu
16 lines
340 B
Nu
export def lumen-search-content [searchstr: string]: any -> table {
|
|
let $tmp = (if ($in != null) {
|
|
$in
|
|
} else {
|
|
pwd
|
|
})
|
|
cd $tmp
|
|
ls -a **/* | par-each {|i|
|
|
{file: $i.name,
|
|
content: (if (($i | get type) == file ) {
|
|
try {open $i.name --raw | find $searchstr} catch {{}}
|
|
})
|
|
}
|
|
} | compact content -e
|
|
}
|