Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/cocoapods/bazel/xcconfig_resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ module XCConfigResolver
def resolved_build_setting_value(setting, settings:)
return unless (value = settings[setting])

sub_prefix = ->(s) { s.sub(%r{\A:/}, '') }
sub_prefix = ->(s) {
str_value = s.to_s
str_value.sub(%r{\A:/}, '')
return str_value
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not keep this in one line sub_prefix = ->(s) { s.to_s.sub(%r{\A:/}, '') }? I would split this into more lines only if you had the intent of further manipulating the intermediary values

Copy link
Author

@acidlynx acidlynx Jan 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Thanks!

resolved = resolve_string_with_build_settings(value, settings: settings)
if Pod::Target::BuildSettings::PLURAL_SETTINGS.include?(setting)
resolved.shellsplit.reject(&:empty?).map(&sub_prefix)
Expand Down