From e987b50610c4756a1f5acaaba8fb865c6e0c8693 Mon Sep 17 00:00:00 2001 From: n5m <72841454+n5m@users.noreply.github.com> Date: Thu, 15 Oct 2020 13:48:39 +0000 Subject: [PATCH] ensure loaf exists before finding (#256) --- nimterop/build/shell.nim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nimterop/build/shell.nim b/nimterop/build/shell.nim index 7c65b71..24075cf 100644 --- a/nimterop/build/shell.nim +++ b/nimterop/build/shell.nim @@ -416,8 +416,14 @@ proc findFiles*(file: string, dir: string, recurse = true, regex = false): seq[s ## `file` is a regular expression if `regex` is true ## ## Turn off recursive search with `recurse` + let + loafExe = loafExePath() + + doAssert fileExists(loafExe), "loaf not compiled: " & loafExe.sanitizePath & + " make sure 'nimble build' or 'nimble install' built it" + var - cmd = loafExePath().quoteShell & " find --rexp $1 \"$2\" $3" + cmd = loafExe.quoteShell & " find --rexp $1 \"$2\" $3" recursive = if recurse: "--recurse" else: "" var