You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/SwiftExtensions/URLExtensions.swift
+12-8Lines changed: 12 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,10 @@
12
12
13
13
packageimport Foundation
14
14
15
+
#if os(Windows)
16
+
import WinSDK
17
+
#endif
18
+
15
19
enumFilePathError:Error,CustomStringConvertible{
16
20
case noFileSystemRepresentation(URL)
17
21
case noFileURL(URL)
@@ -84,14 +88,14 @@ extension URL {
84
88
}
85
89
86
90
packagevarisRoot:Bool{
87
-
#if os(Windows)
88
-
// FIXME: We should call into Windows' native check to check if this path is a root once https://github.com/swiftlang/swift-foundation/issues/976 is fixed.
89
-
returnself.pathComponents.count <=1
90
-
#else
91
-
// On Linux, we may end up with an string for the path due to https://github.com/swiftlang/swift-foundation/issues/980
92
-
// TODO: Remove the check for "" once https://github.com/swiftlang/swift-foundation/issues/980 is fixed.
0 commit comments