fix: Strip more file names in extractor

Closes: #698

I ended up fixing a few Clippy lints while tracking down this problem.
It turns out that the issue was way simpler than I assumed: ".tar.xz"
needed to be added to a slice of extensions to strip.
This commit is contained in:
Josh Megnauth 2025-01-02 23:57:39 -05:00 committed by Jeremy Soller
parent 87fa4ac478
commit 0f5163acc6
2 changed files with 26 additions and 18 deletions

View file

@ -2053,14 +2053,15 @@ impl Application for App {
}
Message::ExtractHere(entity_opt) => {
let paths = self.selected_paths(entity_opt);
if let Some(current_path) = paths.get(0) {
if let Some(destination) = current_path.parent().zip(current_path.file_stem()) {
let destination_path = destination.0.to_path_buf();
self.operation(Operation::Extract {
paths,
to: destination_path,
});
}
if let Some(destination) = paths
.first()
.and_then(|first| first.parent())
.map(|parent| parent.to_path_buf())
{
self.operation(Operation::Extract {
paths,
to: destination,
});
}
}
Message::Key(modifiers, key) => {