Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Commit

Permalink
Filter only .xcodeproj from xcworkspace
Browse files Browse the repository at this point in the history
  • Loading branch information
swiftyfinch committed May 18, 2023
1 parent 09f2cdd commit 8054a8f
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import Foundation
import XcodeProj

struct XcodeWorkspaceReader {
/// Returns: - Project paths.
func read(_ fileURL: URL) throws -> [URL] {
let workspace = try XCWorkspace(pathString: fileURL.path())
return workspace.data.children.map(\.location.path).map {
fileURL.deletingLastPathComponent().appending(path: $0)
}
func readProjects(_ fileURL: URL) throws -> [URL] {
try XCWorkspace(pathString: fileURL.path())
.data.children
.map(\.location.path)
.filter { $0.hasSuffix(".xcodeproj") }
.map { fileURL.deletingLastPathComponent().appending(path: $0) }
}
}

0 comments on commit 8054a8f

Please sign in to comment.