fix(new): no orphan dir on error path; drop stale dead_code allow

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
chrnx committed 2026-07-11 13:03:01 -05:00
1 parent 7044e50982
commit c382602ca7
3 files changed
+13 -3

No files matched your search

+4 -2
View File
@@ -9,10 +9,12 @@ pub fn run(name: &str, template_url: Option<&str>) -> std::io::Result<()> {
return Err(Error::new(ErrorKind::AlreadyExists,
format!("'{name}' already exists")));
}
std::fs::create_dir_all(dest)?;
match template_url {
None => template::write_starter(dest, name)?,
None => {
std::fs::create_dir_all(dest)?;
template::write_starter(dest, name)?;
}
Some(_) => return Err(Error::new(ErrorKind::Unsupported,
"--template-url not implemented yet")),
}