Skip to content

Python Project Templater (PyIDE) v1.0.1

Latest
Compare
Choose a tag to compare
@zzampax zzampax released this 07 Nov 14:35

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(())
}