summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-03-31 12:45:06 -0700
committerGitHub <noreply@github.com>2020-03-31 12:45:06 -0700
commit3aca3f6e11138e17324f0905a34b7ec0fb782e3d (patch)
treea6f85f30aec32273faa4e0affce6aae128e13663
parent3dfb81307cebd0d0987dd1daab3024c34b628539 (diff)
parentd8a326ef36843183dd9c54f2cda5dc1eb695de62 (diff)
downloadchef-3aca3f6e11138e17324f0905a34b7ec0fb782e3d.tar.gz
Merge pull request #9552 from chef/build_essential_macos
Simplify the matching code per code review
-rw-r--r--lib/chef/resource/build_essential.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/chef/resource/build_essential.rb b/lib/chef/resource/build_essential.rb
index 68268f8142..5a41f3895b 100644
--- a/lib/chef/resource/build_essential.rb
+++ b/lib/chef/resource/build_essential.rb
@@ -177,10 +177,8 @@ class Chef
available_updates.error!
# https://rubular.com/r/UPEE5P7mZLvXNs
- label_match = available_updates.stdout.match(/^\s*\* (?:Label: )?(Command Line Tools.*)/)
-
# this will return the match or nil
- label_match[1] unless label_match.nil?
+ available_updates.stdout[/^\s*\* (?:Label: )?(Command Line Tools.*)/, 1]
end
end
end