-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: handle relative symbolic links #98
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the fix! Two minor comments, after which we can merge 🙂
@@ -549,6 +549,14 @@ public struct FileSystem: FileSysteming, Sendable { | |||
) | |||
} | |||
|
|||
public func createSymbolicLink(from: AbsolutePath, to: RelativePath) async throws { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will need to add the method to the FileSysteming
protocol.
Sources/FileSystem/FileSystem.swift
Outdated
logger?.debug("Creating symbolic link from \(from.pathString) to \(to.pathString).") | ||
try await NIOFileSystem.FileSystem.shared.createSymbolicLink( | ||
at: FilePath(from.pathString), | ||
withDestination: FilePath(to.pathString) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about creating a private helper method to combine the two createSymbolicLink
methods?
private func createSymbolicLink(fromPathString: String, toPathString: String) async throws {
logger?.debug("Creating symbolic link from \(fromPathString) to \(toPathString).")
try await NIOFileSystem.FileSystem.shared.createSymbolicLink(
at: FilePath(fromPathString),
withDestination: FilePath(toPathString)
)
}
public func createSymbolicLink(from: AbsolutePath, to: AbsolutePath) async throws {
try await createSymbolicLink(fromPathString: from.pathString, toPathString: to.pathString)
}
I made these changes. You can have another look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again 👏
This should fix tuist/tuist#7145. There may be other or better ways to fix this. But the root issue seems to be handling of an relative symbolic link.