2024-06-27 16:55:09 +00:00
|
|
|
use std::path::Path;
|
|
|
|
|
|
|
|
/// Create directory if missing
|
|
|
|
pub fn create_directory_if_missing<P: AsRef<Path>>(path: P) -> anyhow::Result<()> {
|
|
|
|
let path = path.as_ref();
|
|
|
|
if !path.exists() {
|
|
|
|
std::fs::create_dir_all(path)?;
|
|
|
|
}
|
|
|
|
Ok(())
|
2024-06-27 23:05:02 +00:00
|
|
|
}
|