mirror of
https://github.com/inspec/inspec
synced 2024-11-27 07:00:39 +00:00
Merge pull request #5609 from inspec/nm/chef-license
Fix `--chef-license=accept` option to only show license accepted message
This commit is contained in:
commit
6ae461c208
1 changed files with 5 additions and 1 deletions
|
@ -43,11 +43,15 @@ module Inspec
|
|||
begin
|
||||
if (allowed_commands & ARGV.map(&:downcase)).empty? && # Did they use a non-exempt command?
|
||||
!ARGV.empty? # Did they supply at least one command?
|
||||
LicenseAcceptance::Acceptor.check_and_persist(
|
||||
license_acceptor_output = LicenseAcceptance::Acceptor.check_and_persist(
|
||||
Inspec::Dist::EXEC_NAME,
|
||||
Inspec::VERSION,
|
||||
logger: Inspec::Log
|
||||
)
|
||||
if license_acceptor_output && ARGV.count == 1 && (ARGV.first.include? "--chef-license")
|
||||
Inspec::UI.new.exit
|
||||
end
|
||||
license_acceptor_output
|
||||
end
|
||||
rescue LicenseAcceptance::LicenseNotAcceptedError
|
||||
Inspec::Log.error "#{Inspec::Dist::PRODUCT_NAME} cannot execute without accepting the license"
|
||||
|
|
Loading…
Reference in a new issue