|
@@ -1,6 +1,7 @@
|
|
|
use clap::Parser;
|
|
use clap::Parser;
|
|
|
-use std::process::Command;
|
|
|
|
|
-use crate::create::;
|
|
|
|
|
|
|
+use crate::create::create;
|
|
|
|
|
+
|
|
|
|
|
+mod create;
|
|
|
|
|
|
|
|
#[derive(Parser)]
|
|
#[derive(Parser)]
|
|
|
#[command(version, about, long_about = None)]
|
|
#[command(version, about, long_about = None)]
|
|
@@ -17,14 +18,3 @@ fn main() {
|
|
|
a => eprintln!("Unknown command: {}", a)
|
|
a => eprintln!("Unknown command: {}", a)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-fn create(project_name: String) {
|
|
|
|
|
- let output = Command::new("mkdir")
|
|
|
|
|
- .arg(project_name)
|
|
|
|
|
- .output()
|
|
|
|
|
- .expect("failed");
|
|
|
|
|
-
|
|
|
|
|
- if output.status.success() {
|
|
|
|
|
- println!("created");
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|