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 13
13
import java .nio .file .Path ;
14
14
import java .nio .file .Paths ;
15
15
import java .util .ArrayList ;
16
+ import java .util .Arrays ;
16
17
import java .util .List ;
17
18
import java .util .Locale ;
18
19
import java .util .Optional ;
@@ -105,17 +106,18 @@ public List<String> getCommand() {
105
106
106
107
public List <String > execute (String ... args ) {
107
108
try {
108
- List <String > command = new ArrayList <>();
109
+ List <String > command = new ArrayList <>(args . length + 1 );
109
110
command .add (getExecutable ().getAbsolutePath ());
110
- for (String arg : args ) {
111
- command .add (arg );
112
- }
111
+ command .addAll (Arrays .asList (args ));
113
112
List <String > lines = new ArrayList <>();
114
113
try {
115
114
Process process = new ProcessBuilder ()
116
115
.directory (workingDirectory .toFile ())
116
+ .redirectError (ProcessBuilder .Redirect .DISCARD )
117
117
.command (command )
118
118
.start ();
119
+ // make sure the process does not block waiting for input
120
+ process .getOutputStream ().close ();
119
121
120
122
try (InputStreamReader isr = new InputStreamReader (process .getInputStream ());
121
123
BufferedReader reader = new BufferedReader (isr )) {
You can’t perform that action at this time.
0 commit comments