mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-08 20:45:29 +00:00
use fs_err canonicalize
This commit is contained in:
parent
28b512ae3f
commit
3e52eb6deb
@ -47,7 +47,7 @@ pub fn run(args: Opts, question_policy: QuestionPolicy) -> crate::Result<()> {
|
|||||||
Subcommand::Compress { mut files, output: output_path } => {
|
Subcommand::Compress { mut files, output: output_path } => {
|
||||||
// If the output_path file exists and is the same as some of the input files, warn the user and skip those inputs (in order to avoid compression recursion)
|
// If the output_path file exists and is the same as some of the input files, warn the user and skip those inputs (in order to avoid compression recursion)
|
||||||
if output_path.exists() {
|
if output_path.exists() {
|
||||||
clean_input_files_if_needed(&mut files, &output_path.canonicalize()?);
|
clean_input_files_if_needed(&mut files, &fs::canonicalize(&output_path)?);
|
||||||
}
|
}
|
||||||
// After cleaning, if there are no input files left, exit
|
// After cleaning, if there are no input files left, exit
|
||||||
if files.is_empty() {
|
if files.is_empty() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user