File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
independent-projects/tools/devtools-common/src/main/java/io/quarkus/cli/plugin Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1313import java .nio .file .Path ;
1414import java .nio .file .Paths ;
1515import java .util .ArrayList ;
16+ import java .util .Arrays ;
1617import java .util .List ;
1718import java .util .Locale ;
1819import java .util .Optional ;
@@ -105,17 +106,18 @@ public List<String> getCommand() {
105106
106107 public List <String > execute (String ... args ) {
107108 try {
108- List <String > command = new ArrayList <>();
109+ List <String > command = new ArrayList <>(args . length + 1 );
109110 command .add (getExecutable ().getAbsolutePath ());
110- for (String arg : args ) {
111- command .add (arg );
112- }
111+ command .addAll (Arrays .asList (args ));
113112 List <String > lines = new ArrayList <>();
114113 try {
115114 Process process = new ProcessBuilder ()
116115 .directory (workingDirectory .toFile ())
116+ .redirectError (ProcessBuilder .Redirect .DISCARD )
117117 .command (command )
118118 .start ();
119+ // make sure the process does not block waiting for input
120+ process .getOutputStream ().close ();
119121
120122 try (InputStreamReader isr = new InputStreamReader (process .getInputStream ());
121123 BufferedReader reader = new BufferedReader (isr )) {
You can’t perform that action at this time.
0 commit comments