#!/usr/bin/env python3 """Report the tooling required by the preservation/setup stage.""" import shutil import subprocess import sys def main(): missing = [] for tool in ("git", "git-lfs", "git-xet", "python3", "nix", "direnv", "rustc", "cargo"): path = shutil.which(tool) if not path: missing.append(tool) print(f"{tool}: missing") continue result = subprocess.run([path, "--version"], capture_output=True, text=True) lines = (result.stdout or result.stderr).splitlines() print(f"{tool}: {lines[0] if lines else path}") if result.returncode: missing.append(tool) return bool(missing) if __name__ == "__main__": sys.exit(main())