fix(shell/lean): check whether output file was created or not

This commit is contained in:
Leonardo de Moura 2019-03-18 12:44:00 -07:00
parent 6bd3f1168a
commit d45da2d5ba

View file

@ -546,6 +546,10 @@ int main(int argc, char ** argv) {
if (cpp_output && ok) {
std::ofstream out(*cpp_output);
if (out.fail()) {
std::cerr << "failed to create '" << *cpp_output << "'\n";
return 1;
}
auto mod = module_name_of_file(path.get_path(), mod_fn);
emit_cpp(out, env, mod, to_list(imports.begin(), imports.end()));
}