Skip to content

Commit 1a04ad3

Browse files
committed
Fix problems with spaces in search paths, clean up
1 parent dde3327 commit 1a04ad3

File tree

6 files changed

+25
-32
lines changed

6 files changed

+25
-32
lines changed

Source/Heavy/DPFExporter.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,18 +211,17 @@ class DPFExporter final : public ExporterBase {
211211
args.add("-v");
212212
args.add("-gdpf");
213213

214-
String paths = "-p";
214+
args.add("-p");
215215
for (auto& path : searchPaths) {
216-
paths += " " + path;
216+
args.add(path);
217217
}
218218

219-
args.add(paths);
220-
221219
if (shouldQuit)
222220
return true;
223221

224-
exportingView->logToConsole("Command: " + args.joinIntoString(" ") + "\n");
225-
start(args);
222+
auto const command = args.joinIntoString(" ");
223+
exportingView->logToConsole("Command: " + command + "\n");
224+
Toolchain::startShellScript(command, this);
226225

227226
waitForProcessToFinish(-1);
228227
exportingView->flushConsole();

Source/Heavy/DaisyExporter.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ class DaisyExporter final : public ExporterBase {
249249
auto size = getValue<int>(patchSizeValue);
250250
auto appType = getValue<int>(appTypeValue);
251251

252-
253-
StringArray args = { heavyExecutable.getFullPathName(), pdPatch, "-o", outdir};
252+
253+
StringArray args = { heavyExecutable.getFullPathName(), pdPatch, "-o", outdir.quoted()};
254254

255255
name = name.replaceCharacter('-', '_');
256256
args.add("-n" + name);
@@ -337,15 +337,14 @@ class DaisyExporter final : public ExporterBase {
337337
args.add("-v");
338338
args.add("-gdaisy");
339339

340-
String paths = "-p";
340+
args.add("-p");
341341
for (auto& path : searchPaths) {
342-
paths += " " + path;
342+
args.add(path);
343343
}
344344

345-
args.add(paths);
346-
347-
exportingView->logToConsole("Command: " + args.joinIntoString(" ") + "\n");
348-
start(args);
345+
auto const command = args.joinIntoString(" ");
346+
exportingView->logToConsole("Command: " + command + "\n");
347+
Toolchain::startShellScript(command, this);
349348
waitForProcessToFinish(-1);
350349
exportingView->flushConsole();
351350

Source/Heavy/ExporterBase.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,11 @@ struct ExporterBase : public Component
143143
auto searchPaths = StringArray {};
144144
if (realPatchFile.existsAsFile() && !realPatchFile.isRoot())
145145
{
146+
#if JUCE_WINDOWS
146147
searchPaths.add(realPatchFile.getParentDirectory().getFullPathName().replaceCharacter('\\', '/').quoted());
148+
#else
149+
searchPaths.add(realPatchFile.getParentDirectory().getFullPathName().quoted());
150+
#endif
147151
}
148152
editor->pd->setThis();
149153

Source/Heavy/OWLExporter.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,11 @@ class OWLExporter : public ExporterBase {
107107
args.add("-v");
108108
args.add("-gOWL");
109109

110-
String paths = "-p";
110+
args.add("-p");
111111
for (auto& path : searchPaths) {
112-
paths += " " + path;
112+
args.add(path);
113113
}
114114

115-
args.add(paths);
116-
117115
exportingView->logToConsole("Command: " + args.joinIntoString(" ") + "\n");
118116
start(args);
119117

Source/Heavy/PdExporter.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,17 @@ class PdExporter final : public ExporterBase {
7878
args.add("-v");
7979
args.add("-gpdext");
8080

81-
String paths = "-p";
81+
args.add("-p");
8282
for (auto& path : searchPaths) {
83-
paths += " " + path;
83+
args.add(path);
8484
}
8585

86-
args.add(paths);
87-
8886
if (shouldQuit)
8987
return true;
9088

91-
exportingView->logToConsole("Command: " + args.joinIntoString(" ") + "\n");
92-
start(args);
89+
auto const command = args.joinIntoString(" ");
90+
exportingView->logToConsole("Command: " + command + "\n");
91+
Toolchain::startShellScript(command, this);
9392

9493
waitForProcessToFinish(-1);
9594
exportingView->flushConsole();

Source/Heavy/WASMExporter.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,11 @@ class WASMExporter : public ExporterBase {
8181
args.add("-v");
8282
args.add("-gjs");
8383

84-
String paths = "-p";
84+
args.add("-p");
8585
for (auto& path : searchPaths) {
86-
#if JUCE_WINDOWS
87-
paths += " " + path.replaceCharacter('\\', '/');
88-
#else
89-
paths += " " + path;
90-
#endif
86+
args.add(path);
9187
}
9288

93-
args.add(paths);
94-
9589
if (shouldQuit)
9690
return true;
9791

0 commit comments

Comments
 (0)