Skip to content

Commit

Permalink
feat: better exception on rebuild (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
tdejager authored Jun 26, 2024
1 parent e591a64 commit 13d4c33
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/repror/cli/rebuild_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from repror.internals.build import BuildInfo, RebuildResult, Recipe, _rebuild_package
from repror.internals.db import (
Build,
BuildState,
get_latest_build_with_rebuild,
save,
)
Expand Down Expand Up @@ -69,6 +70,11 @@ def rebuild_recipe(
f"No build found for recipe {recipe.name}. Cannot rebuild."
)

if latest_build.state == BuildState.FAIL:
raise ValueError(
f"Build failed for recipe {recipe.name}. Cannot rebuild."
)

if latest_rebuild and not force:
print("Found latest rebuild. Skipping rebuilding it again")
continue
Expand Down

0 comments on commit 13d4c33

Please sign in to comment.