summaryrefslogtreecommitdiff
path: root/lib/leap_cli/util.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/leap_cli/util.rb')
-rw-r--r--lib/leap_cli/util.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/leap_cli/util.rb b/lib/leap_cli/util.rb
index fdbdc8a..3b0c334 100644
--- a/lib/leap_cli/util.rb
+++ b/lib/leap_cli/util.rb
@@ -55,11 +55,15 @@ module LeapCli
# assert that the command is run without an error.
# if successful, return output.
#
- def assert_run!(cmd, message)
- log2(" * run: #{cmd}")
+ def assert_run!(cmd, message=nil)
cmd = cmd + " 2>&1"
output = `#{cmd}`
- assert!($?.success?, message)
+ unless $?.success?
+ log1(" * run: #{cmd}")
+ log1(" * FAILED: (exit #{$?}) #{output}")
+ else
+ log2(" * run: #{cmd}")
+ end
return output
end