Skip to content

Commit

Permalink
Merge pull request #15 from griffin-stewie/fix/open
Browse files Browse the repository at this point in the history
fix open subcommand won’t work
  • Loading branch information
griffin-stewie authored Nov 7, 2022
2 parents 2b1503c + 2dbdcbb commit f6eece1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Sources/XopenCore/Pathfinder/XcodeFilePathfinder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ public final class XcodeFilePathfinder {
logger.debug("\(content.absoluteString)")
#endif

if let _ = foundURL() {
return .abort
}

if isDirectory {
for ext in xcodeFileExtensions where ext == content.lastPathComponent.ns.pathExtension {
foundURLs.append(content)
Expand Down Expand Up @@ -78,6 +82,10 @@ public final class XcodeFilePathfinder {

extension XcodeFilePathfinder {
fileprivate func foundURL() -> URL? {
if foundURLs.isEmpty {
return nil
}

for ext in Self.defaultXcodeFileExtensions {
let found = foundURLs.first { url in
url.lastPathComponent.ns.pathExtension == ext
Expand Down

0 comments on commit f6eece1

Please sign in to comment.