Merge branch 'devel' of https://git.cscherr.de/PlexSheep/autocrate into devel
cargo devel CI / cargo CI (push) Successful in 3m43s Details

This commit is contained in:
Christoph J. Scherr 2024-02-16 18:37:39 +01:00
commit 660d4bd9da
Signed by: PlexSheep
GPG Key ID: 7CDD0B14851A08EF
4 changed files with 7 additions and 10 deletions

View File

@ -28,7 +28,7 @@ impl Changelog {
let out = cmd.output()?; let out = cmd.output()?;
// FIXME: this does not catch fancy colors, those are from the shell as it seems? I don't // FIXME: this does not catch fancy colors, those are from the shell as it seems? I don't
// get it. // get it.
let buf = String::from_utf8(out.stdout).map_err(|err| ChangelogError::GitUTF8Error(err))?; let buf = String::from_utf8(out.stdout).map_err(ChangelogError::GitUTF8Error)?;
if !out.status.success() { if !out.status.success() {
// TODO: get the stderr for error reporting // TODO: get the stderr for error reporting
// TODO: Make the error more understandable for the user // TODO: Make the error more understandable for the user
@ -43,14 +43,14 @@ impl Changelog {
let mut cmd = Command::new("git"); let mut cmd = Command::new("git");
cmd.arg("describe").arg("--tags").arg("--abbrev=0"); cmd.arg("describe").arg("--tags").arg("--abbrev=0");
let out = cmd.output()?; let out = cmd.output()?;
let buf = String::from_utf8(out.stdout).map_err(|err| ChangelogError::GitUTF8Error(err))?; let buf = String::from_utf8(out.stdout).map_err(ChangelogError::GitUTF8Error)?;
if !out.status.success() { if !out.status.success() {
// TODO: get the stderr for error reporting // TODO: get the stderr for error reporting
// TODO: Make the error more understandable for the user // TODO: Make the error more understandable for the user
return Err(ChangelogError::GitBadStatus(out.status, buf).into()); return Err(ChangelogError::GitBadStatus(out.status, buf).into());
} }
let buf = buf.replace("\n", ""); let buf = buf.replace('\n', "");
return Ok(buf); Ok(buf)
} }
} }

View File

@ -95,6 +95,6 @@ impl Cli {
// less verbose version // less verbose version
Logger::init_mini(Some(ll)).expect("could not initialize Logger"); Logger::init_mini(Some(ll)).expect("could not initialize Logger");
} }
return cli; cli
} }
} }

View File

@ -147,7 +147,7 @@ impl Debug for Config {
write!( write!(
f, f,
"{}", "{}",
format!( format_args!(
"Config {{yaml: {:?}, repo_path: {:?}}}", "Config {{yaml: {:?}, repo_path: {:?}}}",
self.yaml, self.path self.yaml, self.path
) )

View File

@ -14,8 +14,7 @@ async fn main() -> Result<()> {
match cli.command { match cli.command {
Commands::Changelog { .. } => { Commands::Changelog { .. } => {
println!("{}", Changelog::build(&cfg)?.to_string()); println!("{}", Changelog::build(&cfg)?);
// Ok(())
} }
Commands::Release { .. } => { Commands::Release { .. } => {
todo!() todo!()
@ -24,7 +23,5 @@ async fn main() -> Result<()> {
todo!() todo!()
} }
}; };
println!("foo");
Ok(()) Ok(())
} }