Set exit status to return value of Inspec Runner

When invoking inspec using ```inspec exec PATH```, the script always
exits with a 0 status code. This pull request proposes to exit with the
same status code as the Inspec Runner. This behavior is consistent with
how testing platforms of this type typically work.
This commit is contained in:
Blake Hitchcock 2015-12-22 09:40:34 -05:00
parent d17b95b131
commit 10fb57f6a5

View file

@ -87,7 +87,7 @@ class InspecCLI < Thor # rubocop:disable Metrics/ClassLength
runner = Inspec::Runner.new(opts)
runner.add_tests(tests)
runner.run
exit runner.run
rescue RuntimeError => e
puts e.message
end