mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-06 11:35:45 +00:00
idk i just merged and patch some
Signed-off-by: MisileLab <misileminecord@gmail.com>
This commit is contained in:
parent
8023a9157e
commit
9a6d73bf57
8
Cargo.lock
generated
8
Cargo.lock
generated
@ -776,9 +776,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nt-time"
|
||||
version = "0.4.1"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "91dd7a30dbf611fc3c790404c9ef8e1631971a9dd020a45905c7685727e9cf43"
|
||||
checksum = "b1d4f129ec1833164165b1711c30b4fa4a2b12784ffefa9fe877b016704b7165"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"time",
|
||||
@ -1172,9 +1172,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "sevenz-rust"
|
||||
version = "0.2.11"
|
||||
version = "0.5.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0bf83efe73d438a1aad929279a2fc0ff3fb32f841421c09a64f3d04c4d162a23"
|
||||
checksum = "33c7d45965e6557597a30e2d12e15d6a5f438bb7cbc11d5dbe89762541c0cd42"
|
||||
dependencies = [
|
||||
"bit-set",
|
||||
"byteorder",
|
||||
|
@ -26,7 +26,7 @@ lz4_flex = "0.11.1"
|
||||
once_cell = "1.18.0"
|
||||
rayon = "1.8.0"
|
||||
same-file = "1.0.6"
|
||||
sevenz-rust = {version = "0.2.10", features = ["compress"]}
|
||||
sevenz-rust = {version = "0.5.3", features = ["compress"]}
|
||||
snap = "1.1.0"
|
||||
tar = "0.4.40"
|
||||
tempfile = "3.8.1"
|
||||
@ -35,7 +35,6 @@ unrar = "0.5.2"
|
||||
xz2 = "0.1.7"
|
||||
zip = { version = "0.6.6", default-features = false, features = ["time"] }
|
||||
zstd = { version = "0.13.0", default-features = false }
|
||||
sevenz-rust = {version = "0.2.10", features = ["compress"]}
|
||||
|
||||
[target.'cfg(not(unix))'.dependencies]
|
||||
is_executable = "1.0.1"
|
||||
|
@ -1,8 +1,7 @@
|
||||
//! SevenZip archive format compress function
|
||||
use std::{
|
||||
env::current_dir,
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use crate::utils::strip_cur_dir;
|
||||
|
||||
pub fn compress_sevenz(files: Vec<PathBuf>, output_path: &Path) -> crate::Result<bool> {
|
||||
let mut writer = sevenz_rust::SevenZWriter::create(output_path).map_err(crate::Error::SevenzipError)?;
|
||||
@ -10,11 +9,9 @@ pub fn compress_sevenz(files: Vec<PathBuf>, output_path: &Path) -> crate::Result
|
||||
for filep in files.iter() {
|
||||
writer
|
||||
.push_archive_entry::<std::fs::File>(
|
||||
sevenz_rust::SevenZWriter::<std::fs::File>::create_archive_entry(
|
||||
sevenz_rust::SevenZArchiveEntry::from_path(
|
||||
filep,
|
||||
filep
|
||||
.strip_prefix(current_dir()?)
|
||||
.expect("StripPrefix Failed")
|
||||
strip_cur_dir(filep)
|
||||
.as_os_str()
|
||||
.to_str()
|
||||
.unwrap()
|
||||
|
Loading…
x
Reference in New Issue
Block a user