Skip to content

Commit 892ae02

Browse files
committed
and again
1 parent a666c06 commit 892ae02

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

ReactNativeNavigation.podspec

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,26 @@ fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
66

77
# Detect if this is a Swift project by checking common iOS project locations
88
# This avoids the slow recursive Find.find() that can take minutes in CI
9-
def check_for_swift_app_delegate(base_dir)
10-
# Common project directory names to check
11-
['ios', 'example/ios', 'playground/ios', 'app/ios', 'demo/ios'].each do |ios_dir|
12-
ios_path = File.join(base_dir, ios_dir)
13-
next unless Dir.exist?(ios_path)
14-
15-
# Check common AppDelegate.swift locations within ios directory
16-
Dir.glob(File.join(ios_path, '**/AppDelegate.swift'), File::FNM_DOTMATCH).each do |path|
17-
# Exclude Pods, build, and DerivedData directories
18-
next if path =~ /\/(Pods|build|DerivedData)\//
19-
return path if File.exist?(path)
9+
start_dir = File.expand_path('../../', __dir__)
10+
swift_delegate_path = nil
11+
12+
# Common project directory names to check
13+
['ios', 'example/ios', 'playground/ios', 'app/ios', 'demo/ios'].each do |ios_dir|
14+
ios_path = File.join(start_dir, ios_dir)
15+
next unless Dir.exist?(ios_path)
16+
17+
# Check common AppDelegate.swift locations within ios directory
18+
Dir.glob(File.join(ios_path, '**/AppDelegate.swift'), File::FNM_DOTMATCH).each do |path|
19+
# Exclude Pods, build, and DerivedData directories
20+
next if path =~ /\/(Pods|build|DerivedData)\//
21+
if File.exist?(path)
22+
swift_delegate_path = path
23+
break
2024
end
2125
end
22-
nil
26+
break if swift_delegate_path
2327
end
2428

25-
start_dir = File.expand_path('../../', __dir__)
26-
swift_delegate_path = check_for_swift_app_delegate(start_dir)
2729
swift_project = swift_delegate_path && File.exist?(swift_delegate_path)
2830

2931
# Debug output

0 commit comments

Comments
 (0)