This commit is contained in:
Ganesh Viswanathan 2019-04-05 16:42:41 -05:00
commit a17c654fac
2 changed files with 10 additions and 10 deletions

View file

@ -211,12 +211,12 @@ proc getPreprocessor*(fullpath: string, mode = "cpp"): string =
sfile = fullpath.sanitizePath
for inc in gStateRT.includeDirs:
cmd &= &"-I\"{inc}\" "
cmd &= &"-I{inc.quoteShell} "
for def in gStateRT.defines:
cmd &= &"-D{def} "
cmd &= &"\"{fullpath}\""
cmd &= &"\"{fullpath.quoteShell}\""
# Include content only from file
for line in execAction(cmd).splitLines():
@ -357,7 +357,7 @@ proc loadPlugin*(sourcePath: string) =
pdll = sourcePath.dll
if not fileExists(pdll) or
sourcePath.getLastModificationTime() > pdll.getLastModificationTime():
discard execAction("nim c --app:lib " & sourcePath)
discard execAction("nim c --app:lib " & sourcePath.quoteShell)
doAssert fileExists(pdll), "No plugin binary generated for " & sourcePath
let lib = loadLib(pdll)

View file

@ -69,7 +69,7 @@ proc downloadUrl*(url, outdir: string) =
"powershell [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; wget $# -OutFile $#"
else:
"curl $# -o $#"
discard execAction(cmd % [url, outdir/file])
discard execAction(cmd % [url, (outdir/file).quoteShell])
if ext == ".zip":
extractZip(file, outdir)
@ -101,20 +101,20 @@ proc gitPull*(url: string, outdir = "", plist = "", checkout = "") =
mkDir(outdir2)
echo "Setting up Git repo: " & url
discard execAction(&"cd {outdir2} && git init .")
discard execAction(&"cd {outdir2} && git remote add origin {url}")
discard execAction(&"cd {outdir2.quoteShell} && git init .")
discard execAction(&"cd {outdir2.quoteShell} && git remote add origin {url}")
if plist.len != 0:
# TODO: document this, it's not clear
let sparsefile = outdir / ".git/info/sparse-checkout"
discard execAction(&"cd {outdir2} && git config core.sparsecheckout true")
discard execAction(&"cd {outdir2.quoteShell} && git config core.sparsecheckout true")
writeFile(sparsefile, plist)
if checkout.len != 0:
echo "Checking out " & checkout
discard execAction(&"cd {outdir2} && git pull --tags origin master")
discard execAction(&"cd {outdir2} && git checkout {checkout}")
discard execAction(&"cd {outdir2.quoteShell} && git pull --tags origin master")
discard execAction(&"cd {outdir2.quoteShell} && git checkout {checkout}")
else:
echo "Pulling repository"
discard execAction(&"cd {outdir2} && git pull --depth=1 origin master")
discard execAction(&"cd {outdir2.quoteShell} && git pull --depth=1 origin master")