macos: Use ~/Library/Caches/Zed instead of ~/.cache/zed (#17949)

This commit is contained in:
Peter Tripp 2024-09-17 13:51:11 -04:00 committed by GitHub
parent 345efa4e36
commit 7246a0f39c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -59,6 +59,12 @@ pub fn support_dir() -> &'static PathBuf {
pub fn temp_dir() -> &'static PathBuf {
static TEMP_DIR: OnceLock<PathBuf> = OnceLock::new();
TEMP_DIR.get_or_init(|| {
if cfg!(target_os = "macos") {
return dirs::cache_dir()
.expect("failed to determine cachesDirectory directory")
.join("Zed");
}
if cfg!(target_os = "windows") {
return dirs::cache_dir()
.expect("failed to determine LocalAppData directory")