From e9f59db5e99b75c3ff74ccd2a72692f33f5dcd5b Mon Sep 17 00:00:00 2001 From: Jorge Revuelta Date: Tue, 28 Sep 2021 14:46:28 +0200 Subject: [PATCH] Fix building for Xcode 13 and Swift 5.5 So the issue is that in Xcode 13 there are new contents where before just were two directories to the different libPackageDescription like so: --- Sources/PackageConfig/Package.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/PackageConfig/Package.swift b/Sources/PackageConfig/Package.swift index f35efdb..16f7d75 100644 --- a/Sources/PackageConfig/Package.swift +++ b/Sources/PackageConfig/Package.swift @@ -114,7 +114,9 @@ enum Package { let fileManager = FileManager.default let swiftPMDir = swiftPath.replacingOccurrences(of: "bin/swiftc", with: "lib/swift/pm") - let versions = try! fileManager.contentsOfDirectory(atPath: swiftPMDir).filter { $0 != "llbuild" } + let versions = try! fileManager.contentsOfDirectory(atPath: swiftPMDir) + .filter { $0 != "llbuild" } + .filter { $0.first?.isNumber ?? false } let latestVersion = versions.sorted().last! var spmVersionDir = latestVersion