From 8dfe1701dfc3731b3aa2e9ba7c1bae0792563831 Mon Sep 17 00:00:00 2001 From: Alan Charles Date: Thu, 25 Jan 2024 09:25:51 -0700 Subject: [PATCH] add conditional check for windows os in storage --- Sources/Segment/Utilities/Storage.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sources/Segment/Utilities/Storage.swift b/Sources/Segment/Utilities/Storage.swift index f5fdedaf..fa421104 100644 --- a/Sources/Segment/Utilities/Storage.swift +++ b/Sources/Segment/Utilities/Storage.swift @@ -206,6 +206,9 @@ extension Storage { private func eventStorageDirectory() -> URL { #if os(tvOS) || os(macOS) let searchPathDirectory = FileManager.SearchPathDirectory.cachesDirectory + #elseif os(Windows) + // `itemReplacementDirectory` is used to create a temp directory + let searchPathDirectory = FileManager.SearchPathDirectory.itemReplacementDirectory #else let searchPathDirectory = FileManager.SearchPathDirectory.documentDirectory #endif