/// Uninstall the specified package.
///
/// This removes:
/// * the json config files
/// * the shims
/// * the unpacked and initialized package
Uninstall the specified package.
This removes:
the json config files
the shims
the unpacked and initialized package
Uninstall the specified package . This removes : the json config files the shims the unpacked and initialized package
pub fn uninstall(name: &str) -> Fallible<()> {
    let home = volta_home()?;
    // if the package config file exists, use that to remove any installed bins and shims
    let package_config_file = home.default_package_config_file(name);
    let package_found = if package_config_file.exists() {
        let package_config = PackageConfig::from_file(&package_config_file)?;
        for bin_name in package_config.bins {
            remove_config_and_shim(&bin_name, name)?;
        }
        remove_file_if_exists(package_config_file)?;
        true
    } else {
        // there is no package config - check for orphaned binaries
        let package_binary_list = binaries_from_package(name)?;
        if !package_binary_list.is_empty() {
            for bin_name in package_binary_list {
                remove_config_and_shim(&bin_name, name)?;
            }
            true
        } else {
            false
        }
    };
    // if any unpacked and initialized packages exists, remove them
    let package_image_dir = home.package_image_root_dir().join(name);
    remove_dir_if_exists(package_image_dir)?;
    if package_found {
        info!("{} package '{}' uninstalled", success_prefix(), name);
    } else {
        warn!("No package '{}' found to uninstall", name);
    }
    Ok(())
}
pub fn uninstall ( name : & str ) -> Fallible < ( ) > { let home = volta_home ( ) ? ; // if the package config file exists, use that to remove any installed bins and shims let package_config_file = home . default_package_config_file ( name ) ; let package_found = if package_config_file . exists ( ) { let package_config = PackageConfig :: from_file ( & package_config_file ) ? ; for bin_name in package_config . bins { remove_config_and_shim ( & bin_name , name ) ? ; } remove_file_if_exists ( package_config_file ) ? ; true } else { // there is no package config - check for orphaned binaries let package_binary_list = binaries_from_package ( name ) ? ; if ! package_binary_list . is_empty ( ) { for bin_name in package_binary_list { remove_config_and_shim ( & bin_name , name ) ? ; } true } else { false } } ; // if any unpacked and initialized packages exists, remove them let package_image_dir = home . package_image_root_dir ( ) . join ( name ) ; remove_dir_if_exists ( package_image_dir ) ? ; if package_found { info ! ( " " success_prefix ( ) name ) ; } else { warn ! ( " " name ) ; } Ok ( ( ) ) }
Uninstall the specified package.
Uninstall the specified package .
name
&str