Skip to content

Commit

Permalink
fix a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Anas Husseini committed Nov 27, 2024
1 parent 9a3c8ee commit 0d9f839
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions rockcraft/extensions/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,15 @@ def get_root_snippet_extended(self) -> dict[str, Any]:
"""Inject chisel as build-snap if needed."""
root_snippet = self.get_root_snippet()
if self.is_chisel_needed():
if root_snippet["parts"][0].get("build-snaps"):
root_snippet["parts"][0]["build-snaps"].append("chisel/latest/stable")
first_part = list(root_snippet["parts"].keys())[0]
if root_snippet["parts"][first_part].get("build-snaps"):
root_snippet["parts"][first_part]["build-snaps"].append(
"chisel/latest/stable"
)
else:
root_snippet["parts"][0]["build-snaps"] = ["chisel/latest/stable"]
root_snippet["parts"][first_part]["build-snaps"] = [
"chisel/latest/stable"
]
return root_snippet

@final
Expand Down

0 comments on commit 0d9f839

Please sign in to comment.