From bbe5646dad317d86ece8e22f9d61156ecc553739 Mon Sep 17 00:00:00 2001 From: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Date: Wed, 8 Apr 2026 23:55:19 -0700 Subject: [PATCH] fix(deep-link): check update-desktop-database existence before executing On Linux, `update-desktop-database` (from `desktop-file-utils`) may not be installed, especially on KDE systems. Instead of failing with an IO error, log a warning when the command is not found and continue. Non-NotFound errors still propagate as before. Fixes #2265 --- plugins/deep-link/src/lib.rs | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/plugins/deep-link/src/lib.rs b/plugins/deep-link/src/lib.rs index 55476bd781..379df1956d 100644 --- a/plugins/deep-link/src/lib.rs +++ b/plugins/deep-link/src/lib.rs @@ -348,12 +348,28 @@ mod imp { )?; } - Command::new("update-desktop-database") + match Command::new("update-desktop-database") .arg(target) .status() - .inspect_err(crate::error::inspect_command_error( - "update-desktop-database", - ))?; + { + Ok(status) => { + if !status.success() { + tracing::warn!( + "`update-desktop-database` exited with status {status}" + ); + } + } + Err(e) if e.kind() == std::io::ErrorKind::NotFound => { + tracing::warn!( + "`update-desktop-database` not found, skipping MIME database update. \ + Install `desktop-file-utils` to silence this warning." + ); + } + Err(e) => { + tracing::error!("Failed to run `update-desktop-database`: {e}"); + return Err(e.into()); + } + } Command::new("xdg-mime") .args(["default", &file_name, mime_type.as_str()])