From e56372684054f49f64131afb8694959a7bbf5c42 Mon Sep 17 00:00:00 2001 From: Dan Federman Date: Mon, 15 Jan 2024 10:40:54 -0800 Subject: [PATCH] Fallback to FileManager.default.temporaryDirectory on older operating systems --- Tests/SafeDIToolTests/SafeDIToolTests.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Tests/SafeDIToolTests/SafeDIToolTests.swift b/Tests/SafeDIToolTests/SafeDIToolTests.swift index fbe27cc1..81cd1829 100644 --- a/Tests/SafeDIToolTests/SafeDIToolTests.swift +++ b/Tests/SafeDIToolTests/SafeDIToolTests.swift @@ -3130,7 +3130,11 @@ extension URL { #if os(Linux) FileManager.default.temporaryDirectory.appendingPathComponent(UUID().uuidString) #else - URL.temporaryDirectory.appending(path: UUID().uuidString) + if #available(macOS 13.0, iOS 16.0, tvOS 16.0, watchOS 9.0, *) { + URL.temporaryDirectory.appending(path: UUID().uuidString) + } else { + FileManager.default.temporaryDirectory.appendingPathComponent(UUID().uuidString) + } #endif } }