20 lines
487 B
Rust
20 lines
487 B
Rust
use serde::Deserialize;
|
|
|
|
use crate::stage0_config::PleaseConfigBuilder;
|
|
|
|
pub fn get_config_from_stdin<'d, T>(stdin: &'d str) -> PleaseConfigBuilder
|
|
where
|
|
T: Deserialize<'d>,
|
|
T: Into<PleaseConfigBuilder>,
|
|
{
|
|
match serde_yaml::from_str::<'d, T>(stdin) {
|
|
Ok(config) => {
|
|
return config.into();
|
|
}
|
|
Err(e) => {
|
|
tracing::debug!("stdin doesn't contain a valid please config: {}", e);
|
|
}
|
|
}
|
|
PleaseConfigBuilder::default()
|
|
}
|