interstice_cli/data_directory.rs
1use directories::ProjectDirs;
2use std::{fs, path::PathBuf};
3
4pub fn data_file() -> PathBuf {
5 let proj_dirs = ProjectDirs::from(
6 "com", // qualifier (reverse domain)
7 "naloween", // organization
8 "interstice", // application name
9 )
10 .expect("Could not determine data directory");
11
12 let dir = proj_dirs.data_dir(); // persistent app data
13 fs::create_dir_all(dir).expect("Failed to create data directory");
14
15 dir.to_path_buf()
16}