mirror of
https://github.com/Cian-H/iform-invenio.git
synced 2026-08-16 16:32:50 +01:00
25 lines
597 B
Python
25 lines
597 B
Python
import typer
|
|
from loguru import logger
|
|
|
|
from cli.utils import get_project_root
|
|
|
|
app = typer.Typer(help="Environment validation and templating.")
|
|
|
|
import shutil
|
|
|
|
|
|
@app.command()
|
|
def template():
|
|
"""Generate a .env.template file."""
|
|
logger.info("Generating .env.template...")
|
|
|
|
source = get_project_root() / "cli" / "data" / "env.template"
|
|
target = get_project_root() / ".env.template"
|
|
|
|
if not source.exists():
|
|
logger.error(f"Template file not found at {source}")
|
|
raise typer.Exit(1)
|
|
|
|
shutil.copy2(source, target)
|
|
logger.success(f"Generated {target.name}")
|