1
mirror of https://github.com/home-assistant/core synced 2024-09-28 03:04:04 +02:00
ha-core/script/util.py

16 lines
370 B
Python
Raw Normal View History

"""Utility functions for the scaffold script."""
import argparse
from .const import COMPONENT_DIR
def valid_integration(integration):
"""Test if it's a valid integration."""
if not (COMPONENT_DIR / integration).exists():
raise argparse.ArgumentTypeError(
f"The integration {integration} does not exist."
)
return integration