diff --git a/lib/metanorma/cli.rb b/lib/metanorma/cli.rb index c0f0613..ea2033e 100644 --- a/lib/metanorma/cli.rb +++ b/lib/metanorma/cli.rb @@ -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 @@ -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