Skip to content

Commit 0bf4e28

Browse files
committed
don't run the server on first run
1 parent 2ab46f5 commit 0bf4e28

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/main.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,20 @@ fn main() -> Result<(), error::Error> {
3838
let config_path = args.config.unwrap_or_else(Config::default_path);
3939
info!("Loading config from {}", config_path.display());
4040

41-
let config: Config = match confy::load_path(config_path) {
41+
let first_run = !config_path.exists();
42+
let config: Config = match confy::load_path(&config_path) {
4243
Ok(config) => config,
4344
Err(why) => {
4445
error!("Failed to load configuration: {why}");
4546
exit(1);
4647
}
4748
};
4849

50+
if first_run {
51+
info!("Configuration initialized at {}", config_path.display());
52+
return Ok(());
53+
}
54+
4955
match args.command {
5056
Some(Command::Service { command }) => svcmgr::main(command),
5157
Some(Command::Database { command }) => dbmgr::main(command, &config),

0 commit comments

Comments
 (0)