From 6238c935fb69597bf2e2b17e70dd1d364b11ca42 Mon Sep 17 00:00:00 2001 From: Nick Cooke <36927374+ncooke3@users.noreply.github.com> Date: Tue, 2 Apr 2024 13:35:52 -0400 Subject: [PATCH] [Release Tooling] Fix METADATA.md regression introduced in #12595 (#12661) --- .../Sources/ZipBuilder/ZipBuilder.swift | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift b/ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift index 5d980a1f083..2b0b1de7720 100644 --- a/ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift +++ b/ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift @@ -690,11 +690,21 @@ struct ZipBuilder { result += "\n" // Necessary for Resource message to print properly in markdown. // Check if there is a Resources directory, and if so, add the disclaimer to the dependency - // string. + // string. At this point, resources will be at the root of XCFrameworks. do { let fileManager = FileManager.default - let resourceDirs = try fileManager.recursivelySearch(for: .directories(name: "Resources"), - in: dir) + let resourceDirs = try fileManager.contentsOfDirectory( + at: dir, + includingPropertiesForKeys: [.isDirectoryKey] + ).flatMap { + try fileManager.contentsOfDirectory( + at: $0, + includingPropertiesForKeys: [.isDirectoryKey] + ) + }.filter { + $0.lastPathComponent == "Resources" + } + if !resourceDirs.isEmpty { result += Constants.resourcesRequiredText result += "\n" // Separate from next pod in listing for text version.