File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
src/processor/java/org/truffleruby/processor Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ public synchronized void init(ProcessingEnvironment env) {
59
59
revision = runCommand ("git rev-parse --short=8 HEAD" );
60
60
compileDate = runCommand ("git log -1 --date=short --pretty=format:%cd" );
61
61
} catch (Throwable e ) {
62
- env . getMessager (). printMessage ( Kind . ERROR , e . getClass () + " " + e . getMessage () );
62
+ throw new Error ( e );
63
63
}
64
64
}
65
65
@@ -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