Add zed to Flatpak config and data directories (#28952)

Closes #28944 

Release Notes:

- linux: Fixed incorrect config directory being used when Zed is
installed via Flatpak

Signed-off-by: Marko Kungla <marko.kungla@gmail.com>
This commit is contained in:
Marko Kungla 2025-04-19 20:41:03 +03:00 committed by GitHub
parent 703a68eedf
commit 8f308d835a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -74,10 +74,9 @@ pub fn config_dir() -> &'static PathBuf {
if let Ok(flatpak_xdg_config) = std::env::var("FLATPAK_XDG_CONFIG_HOME") {
flatpak_xdg_config.into()
} else {
dirs::config_dir()
.expect("failed to determine XDG_CONFIG_HOME directory")
.join("zed")
dirs::config_dir().expect("failed to determine XDG_CONFIG_HOME directory")
}
.join("zed")
} else {
home_dir().join(".config").join("zed")
}
@ -95,10 +94,9 @@ pub fn data_dir() -> &'static PathBuf {
if let Ok(flatpak_xdg_data) = std::env::var("FLATPAK_XDG_DATA_HOME") {
flatpak_xdg_data.into()
} else {
dirs::data_local_dir()
.expect("failed to determine XDG_DATA_HOME directory")
.join("zed")
dirs::data_local_dir().expect("failed to determine XDG_DATA_HOME directory")
}
.join("zed")
} else if cfg!(target_os = "windows") {
dirs::data_local_dir()
.expect("failed to determine LocalAppData directory")