From d6bcc897c75c007599e39437dd8c5fd044a0475a Mon Sep 17 00:00:00 2001 From: sobczal2 <81999946+sobczal2@users.noreply.github.com> Date: Thu, 31 Jul 2025 01:58:50 +0200 Subject: [PATCH 1/2] improve error message on config dir error --- src/args.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/args.rs b/src/args.rs index 4c1a64ec92..81ae1d327c 100644 --- a/src/args.rs +++ b/src/args.rs @@ -1,5 +1,5 @@ use crate::bug_report; -use anyhow::{anyhow, Result}; +use anyhow::{anyhow, Context, Result}; use asyncgit::sync::RepoPath; use clap::{ builder::ArgPredicate, crate_authors, crate_description, @@ -49,7 +49,9 @@ pub fn process_cmdline() -> Result { .map_or_else(|| PathBuf::from("theme.ron"), PathBuf::from); let confpath = get_app_config_path()?; - fs::create_dir_all(&confpath)?; + fs::create_dir_all(&confpath).with_context(|| { + format!("failed to write config to {}", confpath.display()) + })?; let theme = confpath.join(arg_theme); let notify_watcher: bool = From 1b62de199c5d3e7c692d6eb520753557fc3911c4 Mon Sep 17 00:00:00 2001 From: sobczal2 <81999946+sobczal2@users.noreply.github.com> Date: Mon, 11 Aug 2025 22:20:22 +0200 Subject: [PATCH 2/2] adjust config dir error message --- src/args.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/args.rs b/src/args.rs index 81ae1d327c..b03d88a806 100644 --- a/src/args.rs +++ b/src/args.rs @@ -50,7 +50,10 @@ pub fn process_cmdline() -> Result { let confpath = get_app_config_path()?; fs::create_dir_all(&confpath).with_context(|| { - format!("failed to write config to {}", confpath.display()) + format!( + "failed to create config directory: {}", + confpath.display() + ) })?; let theme = confpath.join(arg_theme);