Fix error in which the project was not created successfully if no module was passed:
fn install_modules(project_name: &str, modules: Vec<String>) -> Result<(), Box<dyn Error>> {
if modules.is_empty() {
return Ok(());
}
let install_modules: ExitStatus = Command::new(format!("{}/.venv/bin/pip3", project_name))
.arg("install")
.args(&modules)
.spawn()?
.wait()?;
if !install_modules.success() {
return Err(Box::from("Failed to install modules"));
}
Ok(())
}