Skip to content

Commit 89ab698

Browse files
committed
Shims
1 parent 10833c9 commit 89ab698

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/XUtils/System+Utils.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@ public typealias FilePath = System.FilePath
44
public typealias FileDescriptor = System.FileDescriptor
55
#else
66
import SystemPackage
7+
import Foundation
8+
79
public typealias FilePath = SystemPackage.FilePath
810
public typealias FileDescriptor = SystemPackage.FileDescriptor
11+
12+
extension URL {
13+
public init?(filePath: FilePath) {
14+
self.init(filePath: filePath.string)
15+
}
16+
}
17+
18+
extension FilePath {
19+
public init?(_ url: URL) {
20+
guard url.isFileURL else { return nil }
21+
self.init(url.path)
22+
}
23+
}
924
#endif

0 commit comments

Comments
 (0)