try load ./rusty-pipe.yaml if no $CONFIG_PATH

master
Bel LaPointe 2023-03-24 13:59:10 -06:00
parent aacdbb3eb2
commit f69fb5163b
4 changed files with 14 additions and 6 deletions

1
rusty-pipe.yaml Symbolic link
View File

@ -0,0 +1 @@
src/testdata/config-stdin-to-stdout.yaml

View File

@ -76,11 +76,13 @@ pub struct UDP {
}
pub fn build_config() -> Result<Config, String> {
let config_path = env::var("CONFIG_PATH");
match config_path {
match env::var("CONFIG_PATH") {
Ok(p) => return build_config_yaml(p),
Err(_) => return Ok(build_config_std()),
}
Err(_) => match build_config_yaml(String::from("./rusty-pipe.yaml")) {
Ok(v) => return Ok(v),
Err(_) => return Ok(build_config_std()),
},
};
}
fn build_config_yaml(path: String) -> Result<Config, String> {

View File

@ -4,6 +4,7 @@ streams:
engine:
name: stdin
output:
format: 'rusty-pipe.yaml: {{ VALUE }}'
debug: true
engine:
name: stdout

View File

@ -1,6 +1,4 @@
todo:
- swapping input mappings by signals/multi mayhem process/whatever
- voice recognition substrings because fun
- rate limiter in panic scenario
- gotta stream keydown on more intervals
- https://crates.io/crates/handlebars
@ -39,3 +37,9 @@ done:
ts: Wed Mar 22 07:27:13 MDT 2023
- todo: gotta get keydown, keyup events into gui
ts: Thu Mar 23 17:07:06 MDT 2023
- todo: load default config if exists at ./rusty-pipe.yaml
ts: Fri Mar 24 13:58:56 MDT 2023
- todo: swapping input mappings by signals/multi mayhem process/whatever
ts: Fri Mar 24 13:58:56 MDT 2023
- todo: voice recognition substrings because fun
ts: Fri Mar 24 13:58:56 MDT 2023