From 15fd4764bd69bf42d0275da1c21ac0a9a3823289 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Tue, 20 Mar 2018 10:18:08 -0700 Subject: Simplify the if installed logic for macos Signed-off-by: Tim Smith --- lib/chef/resource/build_essential.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'lib/chef/resource/build_essential.rb') diff --git a/lib/chef/resource/build_essential.rb b/lib/chef/resource/build_essential.rb index c0b7483ffb..2382f2a1e4 100644 --- a/lib/chef/resource/build_essential.rb +++ b/lib/chef/resource/build_essential.rb @@ -122,10 +122,7 @@ class Chef def xcode_cli_installed? cmd = Mixlib::ShellOut.new("pkgutil --pkgs=com.apple.pkg.CLTools_Executables") cmd.run_command - cmd.error! - true - rescue Mixlib::ShellOut::ShellCommandFailed - false + cmd.error? ? false : true end end -- cgit v1.2.1