diff --git a/bin/inspec b/bin/inspec index dd22d4099..6bdbb8a4a 100755 --- a/bin/inspec +++ b/bin/inspec @@ -52,8 +52,10 @@ class InspecCLI < Thor # rubocop:disable Metrics/ClassLength def json(path) diagnose - profile = Inspec::Profile.from_path(path, opts) - dst = opts[:output].to_s + o = opts.dup + o[:ignore_supports] = true + profile = Inspec::Profile.from_path(path, o) + dst = o[:output].to_s if dst.empty? puts JSON.pretty_generate(profile.info) else @@ -73,7 +75,7 @@ class InspecCLI < Thor # rubocop:disable Metrics/ClassLength o = opts.dup o[:logger] = Logger.new(STDOUT) - o[:ignore_supports] = true # we check for integrety only + o[:ignore_supports] = true # we check for integrity only profile = Inspec::Profile.from_path(path, o) exit 1 unless profile.check end diff --git a/lib/inspec/runner.rb b/lib/inspec/runner.rb index 05050ab39..d38951d4c 100644 --- a/lib/inspec/runner.rb +++ b/lib/inspec/runner.rb @@ -54,7 +54,7 @@ module Inspec Inspec::Metadata.from_ref(x[:ref], x[:content], @profile_id, @conf[:logger]) end metas.each do |meta| - return [] if !ignore_supports && !meta.supports_transport?(@backend) + return [] unless ignore_supports || meta.supports_transport?(@backend) end assets end