Moved Modules into their own files
This commit is contained in:
15
autoload/search-content.nu
Normal file
15
autoload/search-content.nu
Normal file
@@ -0,0 +1,15 @@
|
||||
export def lumen-search-content [searchstr = string]: any -> table {
|
||||
let $tmp = $in
|
||||
mut $path = pwd
|
||||
if ($tmp != null) {
|
||||
$path = $tmp
|
||||
}
|
||||
cd $path
|
||||
ls -a **/* | par-each {|i|
|
||||
{file: $i.name,
|
||||
content: (if (($i | get type) == file ) {
|
||||
try {open $i.name --raw | find $searchstr} catch {|err| {}}
|
||||
})
|
||||
}
|
||||
} | compact content -e
|
||||
}
|
||||
Reference in New Issue
Block a user