Merge branch 'devel' of https://git.cscherr.de/PlexSheep/autocrate into devel
cargo devel CI / cargo CI (push) Failing after 1m51s Details

This commit is contained in:
Christoph J. Scherr 2024-02-24 14:11:00 +01:00
commit 39538b7b01
Signed by: PlexSheep
GPG Key ID: 7CDD0B14851A08EF
3 changed files with 4 additions and 8 deletions

View File

@ -10,7 +10,6 @@ use crate::error::*;
pub mod cli; pub mod cli;
pub mod packages; pub mod packages;
use cli::Cli; use cli::Cli;
use packages::*;
pub trait YamlConfigSection: Debug + Clone + for<'a> Deserialize<'a> { pub trait YamlConfigSection: Debug + Clone + for<'a> Deserialize<'a> {
fn check(&self) -> Result<()>; fn check(&self) -> Result<()>;
@ -65,7 +64,7 @@ impl Pass {
self.check()?; self.check()?;
Ok(match self { Ok(match self {
Self::Text(pass) => pass.clone(), Self::Text(pass) => pass.clone(),
Self::Env(key) => std::env::var(key).map_err(|err| ConfigError::from(err))?, Self::Env(key) => std::env::var(key).map_err(ConfigError::from)?,
Self::File(file) => std::fs::read_to_string(file)?, Self::File(file) => std::fs::read_to_string(file)?,
}) })
} }
@ -75,10 +74,7 @@ impl YamlConfigSection for Pass {
match self { match self {
Self::Text(_) => (), Self::Text(_) => (),
Self::Env(envvar) => { Self::Env(envvar) => {
if !std::env::var(envvar) if !std::env::var(envvar).map_err(ConfigError::from)?.is_empty() {
.map_err(ConfigError::from)?
.is_empty()
{
} else { } else {
return Err(ConfigError::EnvNotSet(envvar.clone()).into()); return Err(ConfigError::EnvNotSet(envvar.clone()).into());
} }

View File

@ -1,3 +1,3 @@
pub enum PackageType { pub enum PackageType {
Cargo Cargo,
} }

View File

@ -22,6 +22,6 @@ pub async fn release(cfg: &Config, apis: &mut ApiCollection) -> Result<()> {
Ok(()) Ok(())
} }
async fn tag(cfg: &Config) -> Result<()> { async fn tag(_cfg: &Config) -> Result<()> {
todo!() todo!()
} }