fn remove_scripts(scripts: &[String], scripts_path: &Path) {
    // todo: Likely not a great approach. QC.
    for entry in
        fs::read_dir(scripts_path).expect("Problem reading dist directory when removing scripts")
    {
        let entry = entry.unwrap();
        if !entry.file_type().unwrap().is_file() {
            continue;
        }
        let data = fs::read_to_string(entry.path()).unwrap();
        for script in scripts {
            if data.contains(&format!("from {}", script)) {
                fs::remove_file(entry.path()).expect("Problem removing console script");
                util::print_color(&format!("Removed console script {}:", script), Color::Green);
            }
        }
    }
}
/// Remove scripts. Used when uninstalling.
Remove scripts. Used when uninstalling.
Remove scripts . Used when uninstalling .
fn remove_scripts(scripts: &[String], scripts_path: &Path) {
    // todo: Likely not a great approach. QC.
    for entry in
        fs::read_dir(scripts_path).expect("Problem reading dist directory when removing scripts")
    {
        let entry = entry.unwrap();
        if !entry.file_type().unwrap().is_file() {
            continue;
        }
        let data = fs::read_to_string(entry.path()).unwrap();
        for script in scripts {
            if data.contains(&format!("from {}", script)) {
                fs::remove_file(entry.path()).expect("Problem removing console script");
                util::print_color(&format!("Removed console script {}:", script), Color::Green);
            }
        }
    }
}
fn remove_scripts ( scripts : & [ String ] , scripts_path : & Path ) { // todo: Likely not a great approach. QC. for entry in fs :: read_dir ( scripts_path ) . expect ( " " ) { let entry = entry . unwrap ( ) ; if ! entry . file_type ( ) . unwrap ( ) . is_file ( ) { continue ; } let data = fs :: read_to_string ( entry . path ( ) ) . unwrap ( ) ; for script in scripts { if data . contains ( & format ! ( " " script ) ) { fs :: remove_file ( entry . path ( ) ) . expect ( " " ) ; util :: print_color ( & format ! ( " " script ) , Color :: Green ) ; } } } }
Remove scripts.
Remove scripts .
scripts
&[String]
scripts_path
&Path
scripts
&[String]
scripts_path
&Path