Method: Inspec::InspecCLI#detect

Defined in:
lib/inspec/cli.rb

#detectObject



118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/inspec/cli.rb', line 118

def detect
  diagnose

  rel = File.join(File.dirname(__FILE__), *%w{.. utils detect.rb})
  detect_util = File.expand_path(rel)
  # exits on execution:
  runner = Inspec::Runner.new(opts)
  profile = Inspec::Profile.for_target(detect_util, opts)
  runner.add_profile(profile)
  exit runner.run
rescue RuntimeError => e
  puts e.message
end