Skip to content

Commit

Permalink
chore: action pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
neilcampbell committed Nov 19, 2024
1 parent 23a5256 commit 6e6aa09
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/algokit/core/typed_client_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,10 @@ def create_for_extension(cls, extension: str, version: str | None) -> "ClientGen
def resolve_output_path(self, app_spec: Path, output_path_pattern: str | None) -> Path | None:
try:
application_json = json.loads(app_spec.read_text())
contract_name: str = (
application_json["name"]
if "name" in application_json
else application_json["contract"]["name"]
if "contract" in application_json and "name" in application_json["contract"]
else ""
)
if contract_name == "":
raise ValueError("Contract name not found")
try:
contract_name: str = application_json["name"] # ARC-56
except KeyError:
contract_name = application_json["contract"]["name"] # ARC-32
except Exception:
logger.error(f"Couldn't parse contract name from {app_spec}", exc_info=True)
return None
Expand Down

0 comments on commit 6e6aa09

Please sign in to comment.