Skip to content

Commit

Permalink
#301 flush std[out,err] before print fatal error summary
Browse files Browse the repository at this point in the history
  • Loading branch information
CAMOBAP committed Feb 12, 2024
1 parent 2ada26b commit 280f54f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/metanorma/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ def self.start(arguments)
UI.say("Error: #{e}. \nNot sure what to run? try: metanorma help")
exit(Errno::ENOENT::Errno)
rescue Errors::FatalCompilationError => e
UI.error(e.message)
exit(-1)
print_fatal_summary
end

def self.root
Expand Down Expand Up @@ -94,5 +93,12 @@ def self.find_command(arguments)
commands = Metanorma::Cli::Command.all_commands.keys
commands.select { |cmd| arguments.include?(cmd.gsub("_", "-")) == true }
end

def self.print_fatal_summary
STDOUT.flush
STDERR.flush
UI.error(e.message)
exit(-1)
end
end
end

0 comments on commit 280f54f

Please sign in to comment.