diff options
| author | Ganesh Viswanathan <dev@genotrance.com> | 2019-10-06 20:24:44 -0700 |
|---|---|---|
| committer | Ganesh Viswanathan <dev@genotrance.com> | 2019-10-06 20:24:44 -0700 |
| commit | 3f8cfa32197bf1da41758fd8e303233c19ecc1e0 (patch) | |
| tree | 4670a1c9717b344d5884d972f3bf1e7d32d36061 | |
| parent | 5f13dbe2026c5966d82f3222a1b925dc9573ed37 (diff) | |
| download | nimterop-3f8cfa32197bf1da41758fd8e303233c19ecc1e0.tar.gz nimterop-3f8cfa32197bf1da41758fd8e303233c19ecc1e0.zip | |
Fix findFile
| -rw-r--r-- | nimterop/build.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/nimterop/build.nim b/nimterop/build.nim index 37fe932..bcbd96a 100644 --- a/nimterop/build.nim +++ b/nimterop/build.nim @@ -263,7 +263,7 @@ proc findFile*(file: string, dir: string, recurse = true, first = false, regex = var cmd = when defined(windows): - "nimgrep --filenames --nocolor $1 $2 $3" + "nimgrep --filenames --oneline --nocolor $1 $2 $3" elif defined(linux): "find $3 $1 -regextype egrep -regex $2" elif defined(osx): @@ -291,8 +291,8 @@ proc findFile*(file: string, dir: string, recurse = true, first = false, regex = for line in files.splitLines(): let f = when defined(windows): - if line.len != 0 and line[0] != ' ' and line[^7 .. ^1] != "matches": - line + if ": " in line: + line.split(": ", maxsplit = 1)[1] else: "" else: |
