From d1eae2f1a01cc853adfe455b7c65e9b28a2b1108 Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Sat, 12 Aug 2017 22:01:47 +0100 Subject: [PATCH] Fixes #351. --- src/nimble.nim | 2 +- tests/tester.nim | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/nimble.nim b/src/nimble.nim index 57c8736..d3ef1e9 100644 --- a/src/nimble.nim +++ b/src/nimble.nim @@ -634,7 +634,7 @@ proc execBackend(options: Options) = var args = "" for path in paths: args.add("--path:\"" & path & "\" ") for option in options.action.compileOptions: - args.add(option & " ") + args.add("\"" & option & "\" ") let backend = if options.action.backend.len > 0: diff --git a/tests/tester.nim b/tests/tester.nim index bb06d8d..804a656 100644 --- a/tests/tester.nim +++ b/tests/tester.nim @@ -453,3 +453,11 @@ suite "can handle two binary versions": check exitCode == QuitSuccess check output.strip() == "v2" +test "can pass args with spaces to Nim (#351)": + cd "binaryPackage/v2": + let (output, exitCode) = execCmdEx(nimblePath & + " c -r" & + " -d:myVar=\"string with spaces\"" & + " binaryPackage") + checkpoint output + check exitCode == QuitSuccess \ No newline at end of file