Use represents_several_files instead of checking len of files

This commit is contained in:
Spyros Roum 2021-10-15 02:45:07 +03:00
parent aa65743e4e
commit baf23fa685

View File

@ -103,7 +103,7 @@ pub fn run(command: Command, flags: &oof::Flags) -> crate::Result<()> {
let output_file = fs::File::create(&output_path)?;
if files.len() == 1 {
if !represents_several_files(&files) {
// It's possible the file is already partially compressed so we don't want to compress it again
// `ouch compress file.tar.gz file.tar.gz.xz` should produce `file.tar.gz.xz` and not `file.tar.gz.tar.gz.xz`
let input_extensions = extension::extensions_from_path(&files[0]);