Only reassign exit_code when it is meant to be EXIT_FAILURE
This commit is contained in:
parent
51e12be9a7
commit
d8314513c3
|
@ -80,7 +80,7 @@ int main(int argc, char* argv[]) {
|
|||
});
|
||||
});
|
||||
if (printResult) cout << "~~~~[Yerbacon compilation result]~~~~\n\n";
|
||||
exit_code = none_of(Units.rbegin(), Units.rend(), [&printResult](future<pair<string, optional<Yerbacon::Exception>>>& currentFuture) -> bool {
|
||||
if (any_of(Units.rbegin(), Units.rend(), [&printResult](future<pair<string, optional<Yerbacon::Exception>>>& currentFuture) -> bool {
|
||||
const auto&& result = currentFuture.get();
|
||||
const bool is_exception = result.second.has_value();
|
||||
if (not is_exception) {
|
||||
|
@ -93,7 +93,9 @@ int main(int argc, char* argv[]) {
|
|||
cout << "Compilation of " << result.first << " has failed with the following error:\n" << result.second.value().what() << '\n';
|
||||
}
|
||||
return is_exception;
|
||||
}) ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
})) {
|
||||
exit_code = EXIT_FAILURE;
|
||||
}
|
||||
} else cout << "No valid file provided.\n";
|
||||
return exit_code;
|
||||
}
|
Loading…
Reference in New Issue