aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGanesh Viswanathan <dev@genotrance.com>2019-04-05 16:42:41 -0500
committerGanesh Viswanathan <dev@genotrance.com>2019-04-05 16:42:41 -0500
commita17c654fac5eeabc2f1a7ebd0a90d0d08ed55831 (patch)
treeaa24db3f04cc508a57211fec9b1e7d78c5859be0
parent7bee0392e7a1a2453f0a2ea428087a8f4f369963 (diff)
downloadnimterop-a17c654fac5eeabc2f1a7ebd0a90d0d08ed55831.tar.gz
nimterop-a17c654fac5eeabc2f1a7ebd0a90d0d08ed55831.zip
Fix #124
-rw-r--r--nimterop/getters.nim6
-rw-r--r--nimterop/git.nim14
2 files changed, 10 insertions, 10 deletions
diff --git a/nimterop/getters.nim b/nimterop/getters.nim
index 2cce70f..3510e27 100644
--- a/nimterop/getters.nim
+++ b/nimterop/getters.nim
@@ -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)
diff --git a/nimterop/git.nim b/nimterop/git.nim
index 740eef2..960ab25 100644
--- a/nimterop/git.nim
+++ b/nimterop/git.nim
@@ -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")