Skip to content
This repository was archived by the owner on Feb 16, 2025. It is now read-only.

Commit 7b94b62

Browse files
committed
fix: make config file if not exists
1 parent b70f5e1 commit 7b94b62

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

Diff for: src/main.rs

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use clap::Parser;
22
use server::ServerError;
3-
use std::{env, io};
3+
use std::{env, fs, io};
44

55
use std::{fs::read_to_string, path::Path};
66

@@ -177,14 +177,7 @@ async fn main() -> Result<(), Error> {
177177
match conf_path.try_exists() {
178178
Ok(false) | Err(_) => {
179179
log::error!("Cannot find config at '{:?}'", conf_path);
180-
return Err(io::Error::new(
181-
io::ErrorKind::InvalidInput,
182-
format!(
183-
"Config path does not exist. Consider creating a config at '{:?}'",
184-
conf_path
185-
),
186-
)
187-
.into());
180+
let _ = fs::write(conf_path, "");
188181
}
189182
_ => {}
190183
}

0 commit comments

Comments
 (0)