cargo_setupx/utils/create_dir.rs
1//! Directory creation utilities
2
3use crate::error::Result;
4use std::fs;
5use std::path::Path;
6
7/// Create a directory, showing appropriate status message
8pub fn create_dir(path: &Path) -> Result<()> {
9 if path.exists() {
10 println!("⏭️ Skipped {} (already exists)", path.display());
11 return Ok(());
12 }
13
14 fs::create_dir_all(path)?;
15 println!("📁 Created {}", path.display());
16 Ok(())
17}