Files
Graphite/desktop/src/dirs.rs
Timon 0462d0ea2f Desktop: Linux improve desktop integration (#3003)
* Move consts to extra module

* Add desktop icons

* Add xdg desktop file

* Improve window attributes

* Make icon background white
2025-08-06 15:05:38 +00:00

17 lines
440 B
Rust

use std::fs::create_dir_all;
use std::path::PathBuf;
use crate::consts::APP_DIRECTORY_NAME;
pub(crate) fn ensure_dir_exists(path: &PathBuf) {
if !path.exists() {
create_dir_all(path).unwrap_or_else(|_| panic!("Failed to create directory at {path:?}"));
}
}
pub(crate) fn graphite_data_dir() -> PathBuf {
let path = dirs::data_dir().expect("Failed to get data directory").join(APP_DIRECTORY_NAME);
ensure_dir_exists(&path);
path
}