fix snapshot creation

This commit is contained in:
mpostma 2021-03-22 16:30:20 +01:00
parent 4847884165
commit a85e7abb0c
No known key found for this signature in database
GPG key ID: CBC8A7C1D7A28C3A
4 changed files with 16 additions and 7 deletions

View file

@ -18,10 +18,12 @@ pub fn to_tar_gz(src: &Path, dest: &Path) -> Result<(), Error> {
}
pub fn from_tar_gz(src: impl AsRef<Path>, dest: impl AsRef<Path>) -> Result<(), Error> {
println!("inflating from {:?} to {:?}", src.as_ref(), dest.as_ref());
let f = File::open(&src)?;
let gz = GzDecoder::new(f);
let mut ar = Archive::new(gz);
create_dir_all(&dest)?;
ar.unpack(&dest)?;
println!("here");
Ok(())
}