From 6be3152f160e2115e30acea27c264a597e80357e Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdx@users.noreply.github.com> Date: Fri, 2 Aug 2024 16:41:04 -0500 Subject: [PATCH] fix: display untrusted file on error --- src/config/config_file/mod.rs | 2 +- src/errors.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/config/config_file/mod.rs b/src/config/config_file/mod.rs index 313aeb7800..f89157c1d8 100644 --- a/src/config/config_file/mod.rs +++ b/src/config/config_file/mod.rs @@ -211,7 +211,7 @@ pub fn trust_check(path: &Path) -> eyre::Result<()> { return Ok(()); } } - Err(UntrustedConfig())? + Err(UntrustedConfig(display_path(path)))? } static IS_TRUSTED: Lazy>> = Lazy::new(|| Mutex::new(HashSet::new())); diff --git a/src/errors.rs b/src/errors.rs index 42fe2b5cc7..ce78b2c05b 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -18,8 +18,8 @@ pub enum Error { VersionNotInstalled(String, String), #[error("{} exited with non-zero status: {}", .0, render_exit_status(.1))] ScriptFailed(String, Option), - #[error("Config file is not trusted.\nTrust it with `mise trust`.")] - UntrustedConfig(), + #[error("Config file {0} is not trusted.\nTrust it with `mise trust`.")] + UntrustedConfig(String), } fn render_exit_status(exit_status: &Option) -> String {