try load ./rusty-pipe.yaml if no $CONFIG_PATH
This commit is contained in:
@@ -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> {
|
||||
|
||||
1
src/testdata/config-stdin-to-stdout.yaml
vendored
1
src/testdata/config-stdin-to-stdout.yaml
vendored
@@ -4,6 +4,7 @@ streams:
|
||||
engine:
|
||||
name: stdin
|
||||
output:
|
||||
format: 'rusty-pipe.yaml: {{ VALUE }}'
|
||||
debug: true
|
||||
engine:
|
||||
name: stdout
|
||||
|
||||
Reference in New Issue
Block a user