Skip to content

Commit

Permalink
feat(backend): respect tool.mina.enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
GreyElaina committed Feb 4, 2024
1 parent 2a7b3ba commit f66afd1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/mina_backend/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
from pdm.backend._vendor import tomli


def _mina_enabled(context: Context) -> bool:
tool_mina = context.config.data.get("tool", {}).get("mina", {})
return bool(tool_mina.get("enabled"))

def _get_build_target(context: Context) -> str | None:
tool_mina = context.config.data.get("tool", {}).get("mina", {})
return (
Expand Down Expand Up @@ -95,7 +99,11 @@ def deep_merge(source: MutableMapping, target: Mapping) -> Mapping:


def pdm_build_initialize(context: Context) -> None:
if not _mina_enabled(context):
return

mina_target = _get_build_target(context)
if mina_target is None:
return

_update_config(context.config, mina_target)

0 comments on commit f66afd1

Please sign in to comment.