Skip to content

Commit 74b3be2

Browse files
authored
fix(config): ensure config file creation if missing (#176)
1 parent b781249 commit 74b3be2

File tree

1 file changed

+4
-0
lines changed
  • crates/nebula-cli/src/config

1 file changed

+4
-0
lines changed

crates/nebula-cli/src/config/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ impl NebulaConfig {
4747

4848
pub fn append(&self) -> anyhow::Result<()> {
4949
let config_file_path = config_file_path(None)?;
50+
if !config_file_path.exists() {
51+
std::fs::write(&config_file_path, "")?;
52+
}
53+
5054
let mut config: NebulaConfigs = Config::builder()
5155
.add_source(File::from(config_file_path.clone()).format(FileFormat::Toml))
5256
.build()?

0 commit comments

Comments
 (0)