fn unpack_workspaces() {
    let ws_dir = Path::new(env!("CARGO_MANIFEST_DIR"))
        .parent()
        .unwrap()
        .join("workspaces");
    let archives = fs::read_dir(ws_dir)
        .unwrap()
        .map(|e| e.unwrap().path())
        .filter(|p| p.extension() == Some(std::ffi::OsStr::new("tgz")));
    for archive in archives {
        let name = archive.file_stem().unwrap();
        let f = fs::File::open(&archive).unwrap();
        let f = flate2::read::GzDecoder::new(f);
        let dest = workspaces_path().join(&name);
        if dest.exists() {
            fs::remove_dir_all(&dest).unwrap();
        }
        let mut archive = tar::Archive::new(f);
        archive.unpack(workspaces_path()).unwrap();
    }
}
/// This unpacks the compressed workspace skeletons into tmp/workspaces.
This unpacks the compressed workspace skeletons into tmp/workspaces.
This unpacks the compressed workspace skeletons into tmp / workspaces .
fn unpack_workspaces() {
    let ws_dir = Path::new(env!("CARGO_MANIFEST_DIR"))
        .parent()
        .unwrap()
        .join("workspaces");
    let archives = fs::read_dir(ws_dir)
        .unwrap()
        .map(|e| e.unwrap().path())
        .filter(|p| p.extension() == Some(std::ffi::OsStr::new("tgz")));
    for archive in archives {
        let name = archive.file_stem().unwrap();
        let f = fs::File::open(&archive).unwrap();
        let f = flate2::read::GzDecoder::new(f);
        let dest = workspaces_path().join(&name);
        if dest.exists() {
            fs::remove_dir_all(&dest).unwrap();
        }
        let mut archive = tar::Archive::new(f);
        archive.unpack(workspaces_path()).unwrap();
    }
}
fn unpack_workspaces ( ) { let ws_dir = Path :: new ( env ! ( " " ) ) . parent ( ) . unwrap ( ) . join ( " " ) ; let archives = fs :: read_dir ( ws_dir ) . unwrap ( ) . map ( | e | e . unwrap ( ) . path ( ) ) . filter ( | p | p . extension ( ) == Some ( std :: ffi :: OsStr :: new ( " " ) ) ) ; for archive in archives { let name = archive . file_stem ( ) . unwrap ( ) ; let f = fs :: File :: open ( & archive ) . unwrap ( ) ; let f = flate2 :: read :: GzDecoder :: new ( f ) ; let dest = workspaces_path ( ) . join ( & name ) ; if dest . exists ( ) { fs :: remove_dir_all ( & dest ) . unwrap ( ) ; } let mut archive = tar :: Archive :: new ( f ) ; archive . unpack ( workspaces_path ( ) ) . unwrap ( ) ; } }
This unpacks the compressed workspace skeletons into tmp/workspaces.
This unpacks the compressed workspace skeletons into tmp / workspaces .