inspec detect --no-color to not give colorful output

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
This commit is contained in:
Nikita Mathur 2021-05-17 16:02:01 +05:30
parent 1e96f31a0c
commit 38fd0ef56b

View file

@ -305,7 +305,12 @@ class Inspec::InspecCLI < Inspec::BaseCLI
puts res.to_json
else
ui.headline("Platform Details")
ui.plain Inspec::BaseCLI.format_platform_info(params: res, indent: 0, color: 36)
if ui.color?
ui.plain Inspec::BaseCLI.format_platform_info(params: res, indent: 0, color: 36)
else
ui.plain Inspec::BaseCLI.format_platform_info(params: res, indent: 0)
end
end
rescue ArgumentError, RuntimeError, Train::UserError => e
$stderr.puts e.message