Only quote program arguments if they actually contain spaces

dev/0.11
modmuss50 2021-12-29 22:02:22 +00:00
parent 005d180e0c
commit e985cb85d4
2 changed files with 7 additions and 2 deletions

View File

@ -210,7 +210,12 @@ public class RunConfig {
}
first = false;
sb.append("\"").append(arg).append("\"");
if (arg.contains(" ")) {
sb.append("\"").append(arg).append("\"");
} else {
sb.append(arg);
}
}
return sb.toString();

View File

@ -33,6 +33,6 @@ class RunConfigUnitTest extends Specification {
def args = RunConfig.joinArguments(["-Dfabric.test=123", "-Dfabric.test=abc 123"])
then:
args == '"-Dfabric.test=123" "-Dfabric.test=abc 123"'
args == '-Dfabric.test=123 "-Dfabric.test=abc 123"'
}
}