Skip to content

Commit 82a0793

Browse files
committed
implement symlink for RerootedFileSystemView
1 parent 3cbcb5a commit 82a0793

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Sources/TSCBasic/FileSystem.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,12 @@ public class RerootedFileSystemView: FileSystem {
935935
return try underlyingFileSystem.createDirectory(path, recursive: recursive)
936936
}
937937

938+
public func createSymbolicLink(_ path: AbsolutePath, pointingAt destination: AbsolutePath) throws {
939+
let path = formUnderlyingPath(path)
940+
let destination = formUnderlyingPath(destination)
941+
return try underlyingFileSystem.createSymbolicLink(path, pointingAt: destination)
942+
}
943+
938944
public func readFileContents(_ path: AbsolutePath) throws -> ByteString {
939945
return try underlyingFileSystem.readFileContents(formUnderlyingPath(path))
940946
}
@@ -945,7 +951,7 @@ public class RerootedFileSystemView: FileSystem {
945951
}
946952

947953
public func removeFileTree(_ path: AbsolutePath) throws {
948-
try underlyingFileSystem.removeFileTree(path)
954+
try underlyingFileSystem.removeFileTree(formUnderlyingPath(path))
949955
}
950956

951957
public func chmod(_ mode: FileMode, path: AbsolutePath, options: Set<FileMode.Option>) throws {

0 commit comments

Comments
 (0)