summaryrefslogtreecommitdiff
path: root/src/app.rs
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2024-12-07 09:54:22 +0100
committerNathan Reiner <nathan@nathanreiner.xyz>2024-12-07 09:54:22 +0100
commit53a9172bddbb83a1c570cc3fed794e7b73c1f1d7 (patch)
tree19640c3d641ba999734043a476fe6e43ea2e0b0d /src/app.rs
parent80c511045ab4248a88d260ed0be6649196ad4e68 (diff)
add default config
Diffstat (limited to 'src/app.rs')
-rw-r--r--src/app.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/app.rs b/src/app.rs
index b166964..5037a8c 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -49,10 +49,12 @@ impl App {
}
pub fn run(mut self, terminal: &mut tui::Tui) -> io::Result<()> {
- if let Err(e) = lua::source(&config::env::USER_RC_PATH) {
- tui::restore()?;
- println!("{}", e);
- return Ok(());
+ if let Err(_) = lua::source(&config::env::USER_RC_PATH) {
+ if let Err(e) = lua::source_default_config() {
+ tui::restore()?;
+ println!("{}", e);
+ return Ok(());
+ }
}
while !{ GlobalState::get().exit } {