Skip to content

Commit

Permalink
feat: report error if acbs-build failed
Browse files Browse the repository at this point in the history
  • Loading branch information
jiegec committed May 14, 2024
1 parent 9156785 commit 8d93c27
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions buildit-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,22 @@ pub async fn find_update_and_update_checksum(
.context("Running acbs-build to update checksums")?;
print_stdout_and_stderr(&output);

if !output.status.success() {
// cleanup repo
Command::new("git")
.arg("reset")
.arg("HEAD")
.arg("--hard")
.current_dir(&abbs_path)
.output()
.context("Reset git repo status")?;

bail!(
"Failed to run acbs-build to update checksum: {}",
String::from_utf8_lossy(&output.stderr)
);
}

let ver = find_version_by_packages(&[pkg.to_string()], &abbs_path)
.into_iter()
.next();
Expand Down

0 comments on commit 8d93c27

Please sign in to comment.