From 730edc4bf5ea553d89d571cd598d293740e55271 Mon Sep 17 00:00:00 2001 From: Brandon Turner Date: Fri, 15 Nov 2013 16:59:37 -0600 Subject: [PATCH] Always exit from maybe_wait_and_exit Previously calling maybe_wait_and_exit wouldn't actually exit. This was the wrong behavior. --- msfupdate | 5 +++-- spec/msfupdate_spec.rb | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/msfupdate b/msfupdate index 88752117cff5..ce32e3025449 100755 --- a/msfupdate +++ b/msfupdate @@ -119,8 +119,6 @@ Options: raise RuntimeError, "Cannot determine checkout type: `#{@msfbase_dir}'" end end - - maybe_wait_and_exit(0) end def update_git! @@ -240,6 +238,8 @@ Options: stdout.puts "" stdin.readline exit exit_code + else + exit exit_code end end @@ -266,4 +266,5 @@ if __FILE__ == $PROGRAM_NAME cli = Msfupdate.new(File.dirname(msfbase)) cli.parse_args(ARGV.dup) cli.run! + cli.maybe_wait_and_exit end diff --git a/spec/msfupdate_spec.rb b/spec/msfupdate_spec.rb index f23b23fb019e..b911b5a156a4 100644 --- a/spec/msfupdate_spec.rb +++ b/spec/msfupdate_spec.rb @@ -49,7 +49,7 @@ def dummy_apt_pathname # By default, we want to ensure tests never actually try to execute any # of the update methods unless we are explicitly testing them subject.stub(:update_apt!) - subject.stub(:update_binary_installer!) + subject.stub(:update_binary_install!) subject.stub(:update_git!) end