129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
|
# File 'lib/inspec/cli.rb', line 129
def archive(path)
diagnose
o = opts.dup
o[:logger] = Logger.new(STDOUT)
o[:logger].level = get_log_level(o.log_level)
o[:backend] = Inspec::Backend.create(target: 'mock://')
profile = Inspec::Profile.for_target(path, o)
result = profile.check
if result && !opts[:ignore_errors] == false
o[:logger].info 'Profile check failed. Please fix the profile before generating an archive.'
return exit 1
end
exit 1 unless profile.archive(opts)
rescue StandardError => e
pretty_handle_exception(e)
end
|