mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-16 08:50:02 +00:00
added zip support, pkg-fmt override
swapped CI to build zips for windows
This commit is contained in:
parent
94ad0db41d
commit
1c25b1346f
7 changed files with 160 additions and 24 deletions
src
|
@ -7,7 +7,7 @@ use cargo_toml::{Manifest};
|
|||
use flate2::read::GzDecoder;
|
||||
use tar::Archive;
|
||||
use xz2::read::XzDecoder;
|
||||
|
||||
use zip::read::ZipArchive;
|
||||
|
||||
use crate::{Meta};
|
||||
|
||||
|
@ -77,6 +77,15 @@ pub fn extract<S: AsRef<Path>, P: AsRef<Path>>(source: S, fmt: PkgFmt, path: P)
|
|||
|
||||
txz.unpack(path)?;
|
||||
},
|
||||
PkgFmt::Zip => {
|
||||
// Extract to install dir
|
||||
debug!("Decompressing from archive '{:?}' to `{:?}`", source.as_ref(), path.as_ref());
|
||||
|
||||
let dat = std::fs::File::open(source)?;
|
||||
let mut zip = ZipArchive::new(dat)?;
|
||||
|
||||
zip.extract(path)?;
|
||||
},
|
||||
PkgFmt::Bin => {
|
||||
debug!("Copying data from archive '{:?}' to `{:?}`", source.as_ref(), path.as_ref());
|
||||
// Copy to install dir
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue