File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/main/java/com/bazel_diff Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -102,9 +102,10 @@ private List<Build.Target> performBazelQuery(String query) throws IOException {
102
102
cmd .add (tempFile .toString ());
103
103
104
104
ProcessBuilder pb = new ProcessBuilder (cmd ).directory (workingDirectory .toFile ());
105
+ pb .redirectError (ProcessBuilder .Redirect .INHERIT );
105
106
Process process = pb .start ();
106
107
ArrayList <Build .Target > targets = new ArrayList <>();
107
-
108
+
108
109
// Prevent process hang in the case where bazel writes to stderr.
109
110
// See https://stackoverflow.com/questions/3285408/java-processbuilder-resultant-process-hangs
110
111
BufferedReader stdError = new BufferedReader (new InputStreamReader (process .getErrorStream ()));
@@ -125,14 +126,14 @@ public void run() {
125
126
}
126
127
});
127
128
tStdError .start ();
128
-
129
+
129
130
while (true ) {
130
131
Build .Target target = Build .Target .parseDelimitedFrom (process .getInputStream ());
131
132
if (target == null ) break ; // EOF
132
133
targets .add (target );
133
134
}
134
-
135
- tStdError .interrupt ();
135
+
136
+ tStdError .interrupt ();
136
137
137
138
Files .delete (tempFile );
138
139
You can’t perform that action at this time.
0 commit comments