From e6831f59011128e10be2e84f1da6a56fe0416652 Mon Sep 17 00:00:00 2001 From: Jonas Maier <> Date: Fri, 6 Mar 2026 14:29:41 +0100 Subject: create config and data dir --- src/main.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 95d24d5..7c51497 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,9 +1,12 @@ use std::ffi::OsStr; +use std::fs; use std::io::{self, IsTerminal, Read, Write}; use std::os::unix::ffi::OsStrExt; use std::os::unix::io::AsRawFd; use std::path::Path; use std::process::{Command, Stdio}; +use std::thread::sleep; +use std::time::Duration; pub mod completion; pub mod cursor; @@ -13,6 +16,7 @@ pub mod parse; pub mod raw; pub mod reload; pub mod run; +mod basedir; use linebuf::LineBuf; use raw::*; @@ -146,6 +150,9 @@ fn event_loop() { let raw = ScopedRawMode::on_fd(fd); raw.enable(); + fs::create_dir_all(basedir::config_dir()).unwrap(); + fs::create_dir_all(basedir::data_dir()).unwrap(); + let mut se = Session { raw, line: LineBuf::new(), @@ -327,6 +334,9 @@ fn main() { } } } + + // prevent incredibly fast panic loops + sleep(Duration::from_secs(1)); } println!("bye"); -- cgit v1.2.3