Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiOelfke committed Jan 9, 2025
1 parent 09ade56 commit 7575043
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Sources/FileSystem/FileSystem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public protocol FileSysteming {
/// - from: The path where the symlink is created.
/// - to: The path the symlink points to.
func createSymbolicLink(from: AbsolutePath, to: AbsolutePath) async throws

/// Creates a relative symlink.
/// - Parameters:
/// - from: The path where the symlink is created.
Expand Down Expand Up @@ -548,13 +548,13 @@ public struct FileSystem: FileSysteming, Sendable {
}

public func createSymbolicLink(from: AbsolutePath, to: AbsolutePath) async throws {
try await createSymbolicLink(fromPathString: from.pathString, toPathString: to.pathString)
try await createSymbolicLink(fromPathString: from.pathString, toPathString: to.pathString)
}

public func createSymbolicLink(from: AbsolutePath, to: RelativePath) async throws {
try await createSymbolicLink(fromPathString: from.pathString, toPathString: to.pathString)
try await createSymbolicLink(fromPathString: from.pathString, toPathString: to.pathString)
}

private func createSymbolicLink(fromPathString: String, toPathString: String) async throws {
logger?.debug("Creating symbolic link from \(fromPathString) to \(toPathString).")
try await NIOFileSystem.FileSystem.shared.createSymbolicLink(
Expand Down
10 changes: 6 additions & 4 deletions Sources/Glob/GlobSearch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@ public func search(
}

let path = baseURL.absoluteString.removingPercentEncoding ?? baseURL.absoluteString
let symbolicLinkDestination: URL = URL(filePath: path).resolvingSymlinksInPath()
let symbolicLinkDestination = URL(filePath: path).resolvingSymlinksInPath()
var isDirectory: ObjCBool = false

let symbolicLinkDestinationPath: String = symbolicLinkDestination.path().removingPercentEncoding ?? symbolicLinkDestination.path()


let symbolicLinkDestinationPath: String = symbolicLinkDestination
.path()
.removingPercentEncoding ?? symbolicLinkDestination.path()

guard FileManager.default.fileExists(
atPath: symbolicLinkDestinationPath,
isDirectory: &isDirectory
Expand Down

0 comments on commit 7575043

Please sign in to comment.