diff --git a/Sources/SafeDITool/SafeDITool.swift b/Sources/SafeDITool/SafeDITool.swift index f2077787..cb56ea6a 100644 --- a/Sources/SafeDITool/SafeDITool.swift +++ b/Sources/SafeDITool/SafeDITool.swift @@ -238,11 +238,15 @@ struct SafeDITool: AsyncParsableCommand { extension Data { fileprivate func write(toPath filePath: String) throws { +#if os(Linux) + try write(to: URL(fileURLWithPath: filePath)) +#else if #available(macOS 13.0, iOS 16.0, tvOS 16.0, watchOS 9.0, *) { try write(to: URL(filePath: filePath)) } else { try write(to: URL(fileURLWithPath: filePath)) } +#endif } } @@ -252,10 +256,14 @@ extension String { } fileprivate var asFileURL: URL { +#if os(Linux) + URL(fileURLWithPath: self) +#else if #available(macOS 13.0, iOS 16.0, tvOS 16.0, watchOS 9.0, *) { URL(filePath: self) } else { URL(fileURLWithPath: self) } +#endif } }