Skip to content

Commit 39cfb35

Browse files
committed
client add default config.conf path
1 parent 0adfd86 commit 39cfb35

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

client/src/config.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,19 @@ impl Config {
2929
pub fn load(config_dir: Option<PathBuf>) -> anyhow::Result<Config> {
3030
let mut conf_loader = HoconLoader::new();
3131

32+
let config_dir = config_dir.or_else(|| {
33+
std::env::current_exe().ok().and_then(|p| {
34+
p.parent().and_then(|p| {
35+
let p = p.join("config.conf");
36+
if p.exists() {
37+
Some(p)
38+
} else {
39+
None
40+
}
41+
})
42+
})
43+
});
44+
3245
if let Some(config_dir) = config_dir {
3346
conf_loader = conf_loader.load_file(config_dir)?;
3447
}

client/src/index.d.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)