Add escude LIST file export

This commit is contained in:
2025-06-03 16:59:15 +08:00
parent 680e297adc
commit 4a05d9de64
19 changed files with 844 additions and 40 deletions

View File

@@ -65,3 +65,13 @@ pub fn write_file<F: AsRef<Path> + ?Sized>(f: &F) -> io::Result<Box<dyn Write>>
Box::new(fs::File::create(f)?)
})
}
pub fn make_sure_dir_exists<F: AsRef<Path> + ?Sized>(f: &F) -> io::Result<()> {
let path = f.as_ref();
if let Some(parent) = path.parent() {
if !parent.exists() {
fs::create_dir_all(parent)?;
}
}
Ok(())
}