Skip to content

Commit 710003d

Browse files
authored
Merge pull request #1302 from rmspacefish/mueller/test-quote-removal
fix for unix systems
2 parents 30ef7da + 97eb094 commit 710003d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

io.sloeber.core/src/io/sloeber/core/tools/ExternalCommandLauncher.java

+13
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,19 @@ public ExternalCommandLauncher(String command) {
151151
this.myRunLock = this;
152152
String[] commandParts = command
153153
.split(" +(?=([^\"]*\"[^\"]*\")*[^\"]*$)"); //$NON-NLS-1$
154+
// Remove quotes for Unix systems
155+
String os = System.getProperty("os.name").toLowerCase();
156+
if(os.indexOf("nix") >= 0 ||
157+
os.indexOf("nux") >= 0 ||
158+
os.indexOf("aix") > 0) {
159+
for (int curCommand = 0; curCommand < commandParts.length; curCommand++) {
160+
if (commandParts[curCommand].startsWith("\"") //$NON-NLS-1$
161+
&& commandParts[curCommand].endsWith("\"")) { //$NON-NLS-1$
162+
commandParts[curCommand] = commandParts[curCommand].substring(1,
163+
commandParts[curCommand].length() - 1);
164+
}
165+
}
166+
}
154167

155168
myProcessBuilder = new ProcessBuilder(Arrays.asList(commandParts));
156169
myProcessBuilder.redirectErrorStream(true);

0 commit comments

Comments
 (0)