use of com.google.copybara.util.ExitCode in project copybara by google.
the class Main method run.
protected final ExitCode run(String[] args) {
// We need a console before parsing the args because it could fail with wrong
// arguments and we need to show the error.
Console console = getConsole(args);
// Configure logs location correctly before anything else. We want to write to the
// correct location in case of any error.
FileSystem fs = FileSystems.getDefault();
try {
configureLog(fs);
} catch (IOException e) {
handleUnexpectedError(console, e.getMessage(), args, e);
return ExitCode.ENVIRONMENT_ERROR;
}
// This is useful when debugging user issues
logger.info("Running: " + Joiner.on(' ').join(args));
console.startupMessage(getVersion());
ExitCode exitCode = runInternal(args, console, fs);
try {
shutdown(exitCode);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
handleUnexpectedError(console, "Execution was interrupted.", args, e);
}
return exitCode;
}
Aggregations