mirror of
https://github.com/aljazceru/Auditor.git
synced 2025-12-17 03:24:18 +01:00
25 lines
933 B
Python
25 lines
933 B
Python
"""Detect and record tool versions."""
|
|
|
|
import click
|
|
|
|
|
|
@click.command("tool-versions")
|
|
@click.option("--out-dir", default="./.pf/audit", help="Output directory")
|
|
def tool_versions(out_dir):
|
|
"""Detect and record tool versions."""
|
|
from theauditor.tools import write_tools_report
|
|
|
|
try:
|
|
res = write_tools_report(out_dir)
|
|
click.echo(f"[OK] Tool versions written to {out_dir}/")
|
|
click.echo(" - TOOLS.md (human-readable)")
|
|
click.echo(" - tools.json (machine-readable)")
|
|
|
|
# Show summary
|
|
python_found = sum(1 for v in res["python"].values() if v != "missing")
|
|
node_found = sum(1 for v in res["node"].values() if v != "missing")
|
|
click.echo(f" - Python tools: {python_found}/4 found")
|
|
click.echo(f" - Node tools: {node_found}/3 found")
|
|
except Exception as e:
|
|
click.echo(f"Error: {e}", err=True)
|
|
raise click.ClickException(str(e)) from e |