Skip to content

Commit

Permalink
Use correct cross-platform #available
Browse files Browse the repository at this point in the history
  • Loading branch information
dfed committed Dec 9, 2023
1 parent b3276b5 commit 9ced9d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/SafeDIPlugin/SafeDIPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ struct SafeDIPlugin: AsyncParsableCommand {

extension Data {
fileprivate func write(toPath filePath: String) throws {
if #available(macOS 13.0, *) {
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))
Expand All @@ -199,7 +199,7 @@ extension String {
}

fileprivate var asFileURL: URL {
if #available(macOS 13.0, *) {
if #available(macOS 13.0, iOS 16.0, tvOS 16.0, watchOS 9.0, *) {
URL(filePath: self)
} else {
URL(fileURLWithPath: self)
Expand Down

0 comments on commit 9ced9d0

Please sign in to comment.