Skip to content

Commit

Permalink
fix: display untrusted file on error
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Aug 2, 2024
1 parent 8d2aed1 commit 6be3152
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/config/config_file/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Mutex<HashSet<PathBuf>>> = Lazy::new(|| Mutex::new(HashSet::new()));
Expand Down
4 changes: 2 additions & 2 deletions src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ pub enum Error {
VersionNotInstalled(String, String),
#[error("{} exited with non-zero status: {}", .0, render_exit_status(.1))]
ScriptFailed(String, Option<ExitStatus>),
#[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<ExitStatus>) -> String {
Expand Down

0 comments on commit 6be3152

Please sign in to comment.