summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2014-12-09 21:03:49 -0800
committerelijah <elijah@riseup.net>2014-12-09 21:03:49 -0800
commita8d2af84f284e87dce377f4e6c163abc7cf6dd43 (patch)
tree16f659fac9024ee8007a73db0d0c2b4e186cf4cc
parent1dee31e3ebf69d4fe392633881d7c78dd94dc0c8 (diff)
exit 1 if `leap test --continue` fails anywhere. closes #6519
-rw-r--r--lib/leap_cli/commands/test.rb6
-rw-r--r--lib/leap_cli/util.rb10
2 files changed, 13 insertions, 3 deletions
diff --git a/lib/leap_cli/commands/test.rb b/lib/leap_cli/commands/test.rb
index 962053d..73207b3 100644
--- a/lib/leap_cli/commands/test.rb
+++ b/lib/leap_cli/commands/test.rb
@@ -18,7 +18,11 @@ module LeapCli; module Commands
ssh.run(test_cmd(options))
end
rescue Capistrano::CommandError => exc
- bail! unless options[:continue]
+ if options[:continue]
+ exit_status(1)
+ else
+ bail!
+ end
end
end
end
diff --git a/lib/leap_cli/util.rb b/lib/leap_cli/util.rb
index 07ffcec..b648a3d 100644
--- a/lib/leap_cli/util.rb
+++ b/lib/leap_cli/util.rb
@@ -13,8 +13,14 @@ module LeapCli
##
def exit_status(code=nil)
- @exit_status = code if code
- @exit_status
+ if !code.nil?
+ if code == 0 && @@exit_status.nil?
+ @@exit_status = 0
+ else
+ @@exit_status = code
+ end
+ end
+ @@exit_status
end
#