on master help sign in
Create all parent directories for config and cache
037f45fWojciech Kępka
helix-term/src/main.rs+2−2
@@ -42,7 +42,7 @@ fn setup_logging(logpath: PathBuf, verbosity: u64) -> Result<()> {
42async fn main() -> Result<()> {
42async fn main() -> Result<()> {
43 let cache_dir = helix_core::cache_dir();
43 let cache_dir = helix_core::cache_dir();
44 if !cache_dir.exists() {
44 if !cache_dir.exists() {
45− std::fs::create_dir(&cache_dir).ok();
45+ std::fs::create_dir_all(&cache_dir).ok();
46 }
46 }
47
47
48 let logpath = cache_dir.join("helix.log");
48 let logpath = cache_dir.join("helix.log");
@@ -86,7 +86,7 @@ FLAGS:
86
86
87 let conf_dir = helix_core::config_dir();
87 let conf_dir = helix_core::config_dir();
88 if !conf_dir.exists() {
88 if !conf_dir.exists() {
89− std::fs::create_dir(&conf_dir).ok();
89+ std::fs::create_dir_all(&conf_dir).ok();
90 }
90 }
91
91
92 setup_logging(logpath, args.verbosity).context("failed to initialize logging")?;
92 setup_logging(logpath, args.verbosity).context("failed to initialize logging")?;