Skip to content

Commit

Permalink
tweak: improve error message
Browse files Browse the repository at this point in the history
in case the user is trying to decompress a file with no filestem, just
the extension, which is confusing
  • Loading branch information
marcospb19 committed Nov 18, 2024
1 parent 5b78b96 commit 4bb759b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ pub fn check_mime_type(
if let Some(detected_format) = try_infer_extension(path) {
// Inferring the file extension can have unpredicted consequences (e.g. the user just
// mistyped, ...) which we should always inform the user about.
info_accessible(format!(
"Detected file: `{}` extension as `{}`",
warning(format!(
"We detected a file named `{}`, do you want to decompress it?",
path.display(),
detected_format
));

if user_wants_to_continue(path, question_policy, QuestionAction::Decompression)? {
Expand Down

0 comments on commit 4bb759b

Please sign in to comment.