mirror of
https://github.com/lifegpc/msg-tool.git
synced 2026-07-06 07:03:28 +08:00
Add escude LIST file export
This commit is contained in:
@@ -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(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user