process stderr.
This commit is contained in:
parent
42411d7324
commit
00e1313980
@ -1,7 +1,7 @@
|
|||||||
use std::fs;
|
use std::fs;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
use std::process::Command;
|
use std::process::{Command, Stdio};
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|
||||||
fn unar_file(path: &Path) -> io::Result<()> {
|
fn unar_file(path: &Path) -> io::Result<()> {
|
||||||
@ -11,6 +11,7 @@ fn unar_file(path: &Path) -> io::Result<()> {
|
|||||||
let output = Command::new("unar")
|
let output = Command::new("unar")
|
||||||
.current_dir(parent_dir)
|
.current_dir(parent_dir)
|
||||||
.arg(filename)
|
.arg(filename)
|
||||||
|
.stderr(Stdio::piped())
|
||||||
.output();
|
.output();
|
||||||
|
|
||||||
match output {
|
match output {
|
||||||
@ -32,7 +33,7 @@ fn is_compressed(path: &Path) -> bool {
|
|||||||
if let Some(ext) = path.extension() {
|
if let Some(ext) = path.extension() {
|
||||||
if let Some(ext) = ext.to_str() {
|
if let Some(ext) = ext.to_str() {
|
||||||
let ext = ext.to_lowercase();
|
let ext = ext.to_lowercase();
|
||||||
return ext == "zip" || ext == "rar";
|
return ext == "zip" || ext == "rar" || ext == "7z";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user