group config files refactored to groups.d and subfolders, WIP common config file

This commit is contained in:
2021-10-05 00:44:39 +02:00
parent 3a4f0ef153
commit 7ea6225ae9
5 changed files with 509 additions and 252 deletions
+4 -5
View File
@@ -36,7 +36,7 @@ async fn main() -> anyhow::Result<()> {
.short("c")
.long("config")
.takes_value(true)
.help("set custom storage file, defaults to groups.json"),
.help("set custom config directory, defaults to groups.d"),
)
.arg(
Arg::with_name("auth")
@@ -75,9 +75,8 @@ async fn main() -> anyhow::Result<()> {
.filter_module("reqwest", LevelFilter::Warn)
.init();
let store = store::ConfigStore::new(StoreOptions {
store_path: args.value_of("config").unwrap_or("groups.json").to_string(),
save_pretty: true,
let store = store::ConfigStore::load_from_fs(StoreOptions {
store_dir: args.value_of("config").unwrap_or(".").to_string(),
})
.await?;
@@ -112,7 +111,7 @@ async fn main() -> anyhow::Result<()> {
}
// Start
let groups = store.spawn_groups().await;
let groups = store.spawn_groups().await?;
let mut handles = vec![];
for mut g in groups {