@@ -237,7 +237,7 @@ class DaisyExporter final : public ExporterBase {
237237 return getExitCode ();
238238 }
239239
240- bool performExport (String pdPatch, String outdir, String name, String copyright, StringArray searchPaths) override
240+ bool performExport (String const & pdPatch, String const & outdir, String const & name, String const & copyright, StringArray const & searchPaths) override
241241 {
242242 auto target = getValue<int >(targetBoardValue) - 1 ;
243243 bool compile = getValue<int >(exportTypeValue) - 1 ;
@@ -248,15 +248,19 @@ class DaisyExporter final : public ExporterBase {
248248 auto rate = getValue<int >(samplerateValue) - 1 ;
249249 auto size = getValue<int >(patchSizeValue);
250250 auto appType = getValue<int >(appTypeValue);
251+
252+ #if JUCE_WINDOWS
253+ auto const heavyPath = heavyExecutable.getFullPathName ().replaceCharacter (' \\ ' , ' /' );
254+ #else
255+ auto const heavyPath = heavyExecutable.getFullPathName ();
256+ #endif
257+ StringArray args = { heavyPath.quoted (), pdPatch.quoted (), " -o" , outdir.quoted () };
251258
252- StringArray args = { heavyExecutable.getFullPathName (), pdPatch, " -o" + outdir };
253-
254- name = name.replaceCharacter (' -' , ' _' );
255259 args.add (" -n" + name);
256260
257261 if (copyright.isNotEmpty ()) {
258262 args.add (" --copyright" );
259- args.add (" \" " + copyright + " \" " );
263+ args.add (copyright. quoted () );
260264 }
261265
262266 // set board definition
@@ -331,21 +335,19 @@ class DaisyExporter final : public ExporterBase {
331335
332336 metaJson->setProperty (" daisy" , metaDaisy);
333337 auto metaJsonFile = createMetaJson (metaJson);
334- args.add (" -m" + metaJsonFile.getFullPathName ());
338+ args.add (" -m" + metaJsonFile.getFullPathName (). quoted () );
335339
336340 args.add (" -v" );
337341 args.add (" -gdaisy" );
338342
339- String paths = " -p" ;
343+ args. add ( " -p" ) ;
340344 for (auto & path : searchPaths) {
341- paths += " " + path;
345+ args. add ( path) ;
342346 }
343347
344- args.add (paths);
345-
346- auto compileString = args.joinIntoString (" " );
347- exportingView->logToConsole (" Command: " + compileString + " \n " );
348- start (compileString);
348+ auto const command = args.joinIntoString (" " );
349+ exportingView->logToConsole (" Command: " + command + " \n " );
350+ Toolchain::startShellScript (command, this );
349351 waitForProcessToFinish (-1 );
350352 exportingView->flushConsole ();
351353
@@ -385,15 +387,16 @@ class DaisyExporter final : public ExporterBase {
385387#if JUCE_WINDOWS
386388 auto buildScript = make.getFullPathName ().replaceCharacter (' \\ ' , ' /' )
387389 + " -j4 -f "
388- + sourceDir.getChildFile (" Makefile" ).getFullPathName ().replaceCharacter (' \\ ' , ' /' )
390+ + sourceDir.getChildFile (" Makefile" ).getFullPathName ().replaceCharacter (' \\ ' , ' /' ).quoted ()
391+ + " SHELL=" + Toolchain::dir.getChildFile (" bin" ).getChildFile (" bash.exe" ).getFullPathName ().replaceCharacter (' \\ ' , ' /' ).quoted ()
389392 + " GCC_PATH="
390393 + gccPath.replaceCharacter (' \\ ' , ' /' )
391394 + " PROJECT_NAME=" + name;
392395
393396 Toolchain::startShellScript (buildScript, this );
394397#else
395398 String buildScript = make.getFullPathName ()
396- + " -j4 -f " + sourceDir.getChildFile (" Makefile" ).getFullPathName ()
399+ + " -j4 -f " + sourceDir.getChildFile (" Makefile" ).getFullPathName (). quoted ()
397400 + " GCC_PATH=" + gccPath
398401 + " PROJECT_NAME=" + name;
399402
0 commit comments