From f681a840eb7d382606e5798acb12fce7889eedab Mon Sep 17 00:00:00 2001 From: Salma ElTarzi Date: Sun, 18 Mar 2018 12:47:21 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20a=20bug=20where=20linking?= =?UTF-8?q?=20failed=20if=20project=20doesn't=20have=20a=20target=20named?= =?UTF-8?q?=20like=20the=20project?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- link.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/link.rb b/link.rb index 9e16808..b51e279 100644 --- a/link.rb +++ b/link.rb @@ -26,7 +26,7 @@ bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/InstabugCore.framework/str project = Xcodeproj::Project.open(project_location) frameworks_group = project.groups.find { |group| group.display_name == 'Frameworks' } frameworks_group ||= project.new_group('Frameworks') -default_target = project.targets.find { |target| target.to_s == default_target_name } +default_target = project.targets.find { |target| target.to_s == default_target_name } || project.targets.first targets = project.targets.select { |target| (target.is_a? Xcodeproj::Project::Object::PBXNativeTarget) && (target.product_type == "com.apple.product-type.application") && (target.platform_name == :ios) }