Fix findFile
This commit is contained in:
parent
5f13dbe202
commit
3f8cfa3219
1 changed files with 3 additions and 3 deletions
|
|
@ -263,7 +263,7 @@ proc findFile*(file: string, dir: string, recurse = true, first = false, regex =
|
||||||
var
|
var
|
||||||
cmd =
|
cmd =
|
||||||
when defined(windows):
|
when defined(windows):
|
||||||
"nimgrep --filenames --nocolor $1 $2 $3"
|
"nimgrep --filenames --oneline --nocolor $1 $2 $3"
|
||||||
elif defined(linux):
|
elif defined(linux):
|
||||||
"find $3 $1 -regextype egrep -regex $2"
|
"find $3 $1 -regextype egrep -regex $2"
|
||||||
elif defined(osx):
|
elif defined(osx):
|
||||||
|
|
@ -291,8 +291,8 @@ proc findFile*(file: string, dir: string, recurse = true, first = false, regex =
|
||||||
for line in files.splitLines():
|
for line in files.splitLines():
|
||||||
let f =
|
let f =
|
||||||
when defined(windows):
|
when defined(windows):
|
||||||
if line.len != 0 and line[0] != ' ' and line[^7 .. ^1] != "matches":
|
if ": " in line:
|
||||||
line
|
line.split(": ", maxsplit = 1)[1]
|
||||||
else:
|
else:
|
||||||
""
|
""
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue