Only quote program arguments if they actually contain spaces

This commit is contained in:
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"'
}
}