plugin ins/outs

This commit is contained in:
🪞👃🪞 2024-06-27 10:18:10 +03:00
parent da1d3220f9
commit 9351887ae6
9 changed files with 187 additions and 64 deletions

View file

@ -1,6 +1,7 @@
use crate::prelude::*;
const CONFIG_FILE_NAME: &'static str = "dawdle.toml";
const CONFIG_FILE_NAME: &'static str = "tek.toml";
const PROJECT_FILE_NAME: &'static str = "project.toml";
pub fn create_dirs (xdg: &microxdg::XdgApp) -> Result<(), Box<dyn Error>> {
use std::{path::Path,fs::{File,create_dir_all}};
@ -19,5 +20,10 @@ pub fn create_dirs (xdg: &microxdg::XdgApp) -> Result<(), Box<dyn Error>> {
println!("Creating {data_dir:?}");
create_dir_all(&data_dir)?;
}
let project_path = data_dir.join(PROJECT_FILE_NAME);
if !Path::new(&project_path).exists() {
println!("Creating {project_path:?}");
File::create_new(&project_path)?;
}
Ok(())
}