On platforms without state_dir, fall back to ~/.local/state
This commit is contained in:
parent
3a8ebf9197
commit
637c454af8
1 changed files with 6 additions and 1 deletions
|
|
@ -48,7 +48,12 @@ fn get_state_dir() -> Option<PathBuf> {
|
|||
return Some(PathBuf::from(home).join(".local").join("state"));
|
||||
}
|
||||
}
|
||||
dirs::state_dir()
|
||||
if let Some(state_dir) = dirs::state_dir() {
|
||||
return Some(state_dir);
|
||||
}
|
||||
// On platforms without state_dir, fall back to ~/.local/state
|
||||
let home_dir = dirs::home_dir()?;
|
||||
Some(home_dir.join(".local").join(".state"))
|
||||
}
|
||||
|
||||
/// Get the data directory, with Flatpak sandbox support.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue