File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/processor/java/org/truffleruby/processor Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -80,13 +80,20 @@ private File findHome() throws URISyntaxException {
80
80
return source .getParentFile ();
81
81
}
82
82
83
- private String runCommand (String command ) throws IOException {
83
+ private String runCommand (String command ) throws IOException , InterruptedException {
84
84
final Process git = new ProcessBuilder (command .split ("\\ s+" ))
85
85
.directory (trufflerubyHome )
86
86
.start ();
87
+ final String firstLine ;
87
88
try (BufferedReader reader = new BufferedReader (new InputStreamReader (git .getInputStream ()))) {
88
- return reader .readLine ();
89
+ firstLine = reader .readLine ();
89
90
}
91
+
92
+ final int exitCode = git .waitFor ();
93
+ if (exitCode != 0 ) {
94
+ throw new Error ("Command " + command + " failed with exit code " + exitCode );
95
+ }
96
+ return firstLine ;
90
97
}
91
98
92
99
@ Override
You can’t perform that action at this time.
0 commit comments