Skip to content

Commit

Permalink
I hate this, but this brings back the minitest output... still with a…
Browse files Browse the repository at this point in the history
… zero return code
  • Loading branch information
jmarrec committed Apr 23, 2024
1 parent 98ac8d3 commit e52af4d
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/cli/UpdateCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,33 +67,37 @@ namespace cli {
cmd += fmt::format("ARGV << \"{}\"\n", arg);
}
cmd += fmt::format(R"(
begin
require '{}'
at_exit {{
STDOUT.flush
STDERR.flush
}}
begin
require '{}'
0
rescue SystemExit => e
# puts "System Exit"
# puts "System Exit: #{{e.status}}"
if !e.success?
STDERR.puts
STDERR.puts "#{{e.class}}: #{{e.message}} with return code #{{e.status}} "
STDERR.puts "Backtrace:\n\t" + e.backtrace.join("\n\t")
STDERR.flush
end
e.status
rescue Exception => e
STDERR.puts
STDERR.puts "#{{e.class}}: #{{e.message}}"
STDERR.puts "Backtrace:\n\t" + e.backtrace.join("\n\t")
STDERR.flush
raise
end
)",
rubyScriptPath.generic_string());
try {
auto ret_so = rubyEngine->eval(cmd);
auto ret_code = rubyEngine->getAs<int>(ret_so);
exit(ret_code);
// fmt::print("ret_code={}\n", ret_code);
if (ret_code != 0) {
exit(ret_code);
}
} catch (...) {
// Bail faster though ruby isn't slow like python
fmt::print(stderr, "Failed to execute '{}'\n", rubyScriptPath.generic_string());
Expand Down

0 comments on commit e52af4d

Please sign in to comment.