From 47b3bb60a20674d029950ebd39f6aacf67e81866 Mon Sep 17 00:00:00 2001 From: elijah Date: Wed, 20 Jul 2016 23:46:48 -0700 Subject: include support for AWS via fog --- lib/leap_cli/util.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'lib/leap_cli/util.rb') diff --git a/lib/leap_cli/util.rb b/lib/leap_cli/util.rb index 29658da..45606b7 100644 --- a/lib/leap_cli/util.rb +++ b/lib/leap_cli/util.rb @@ -40,14 +40,13 @@ module LeapCli # # exit with error code and with a message that we are bailing out. # - def bail!(*message) - if block_given? - LeapCli.logger.log_level = 3 - yield - elsif message - log 0, *message + def bail!(*message, &block) + LeapCli.logger.log_level = 3 if LeapCli.logger.log_level < 3 + if message.any? + log(0, *message, &block) + else + log(0, :bailing, "out", &block) end - log 0, :bail, "" raise SystemExit.new(exit_status || 1) end -- cgit v1.2.3