From f2f4b5ccc3cb3a6ebb8d141ea26a119f74ce39b4 Mon Sep 17 00:00:00 2001 From: Stephan Diederich Date: Wed, 12 Jan 2022 16:28:43 +0100 Subject: [PATCH] on macOS, like on tvOS use the caches folder on macOS, if the app is not sandboxed, the folder for events storage ends up in the user's `~/Documents/` directory, which potentially gets synced via iCloud Documents. Let's also use the caches directory on macOS. --- Sources/Segment/Utilities/Storage.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Segment/Utilities/Storage.swift b/Sources/Segment/Utilities/Storage.swift index 3f52d93c..38d3fc56 100644 --- a/Sources/Segment/Utilities/Storage.swift +++ b/Sources/Segment/Utilities/Storage.swift @@ -182,7 +182,7 @@ extension Storage { } private func eventStorageDirectory() -> URL { - #if os(tvOS) + #if os(tvOS) || os(macOS) let searchPathDirectory = FileManager.SearchPathDirectory.cachesDirectory #else let searchPathDirectory = FileManager.SearchPathDirectory.documentDirectory