diff options
author | elijah <elijah@riseup.net> | 2012-10-27 15:56:48 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2012-10-27 15:56:48 -0700 |
commit | 669bf5aa6f81e0cd1d1956bee6ed26715fb896fa (patch) | |
tree | 1f2d82b28f714ce937b688f1d0814a862a6f9f8b /lib/leap_cli/util.rb | |
parent | 20ab16c583a139ff64b83ad5450257ca1dc5924e (diff) |
auto run 'git submodule update --init' on leap platform if needed
Diffstat (limited to 'lib/leap_cli/util.rb')
-rw-r--r-- | lib/leap_cli/util.rb | 10 |
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 |