Only quote program arguments if they actually contain spaces
This commit is contained in:
		
							parent
							
								
									005d180e0c
								
							
						
					
					
						commit
						e985cb85d4
					
				
					 2 changed files with 7 additions and 2 deletions
				
			
		|  | @ -210,7 +210,12 @@ public class RunConfig { | |||
| 			} | ||||
| 
 | ||||
| 			first = false; | ||||
| 
 | ||||
| 			if (arg.contains(" ")) { | ||||
| 				sb.append("\"").append(arg).append("\""); | ||||
| 			} else { | ||||
| 				sb.append(arg); | ||||
| 			} | ||||
| 		} | ||||
| 
 | ||||
| 		return sb.toString(); | ||||
|  |  | |||
|  | @ -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"' | ||||
|     } | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue