Skip to content

Commit 1d22485

Browse files
authored
Improve error message on config dir error (#2684)
1 parent f5893d9 commit 1d22485

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/args.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::bug_report;
2-
use anyhow::{anyhow, Result};
2+
use anyhow::{anyhow, Context, Result};
33
use asyncgit::sync::RepoPath;
44
use clap::{
55
builder::ArgPredicate, crate_authors, crate_description,
@@ -49,7 +49,12 @@ pub fn process_cmdline() -> Result<CliArgs> {
4949
.map_or_else(|| PathBuf::from("theme.ron"), PathBuf::from);
5050

5151
let confpath = get_app_config_path()?;
52-
fs::create_dir_all(&confpath)?;
52+
fs::create_dir_all(&confpath).with_context(|| {
53+
format!(
54+
"failed to create config directory: {}",
55+
confpath.display()
56+
)
57+
})?;
5358
let theme = confpath.join(arg_theme);
5459

5560
let notify_watcher: bool =

0 commit comments

Comments
 (0)