MCPcopy Create free account
hub / github.com/vercel/vercel / check_tools

Function check_tools

packages/python-analysis/scripts/profile-wasm.py:131–148  ·  view source on GitHub ↗

Verify required tools are available.

()

Source from the content-addressed store, hash-verified

129
130
131def check_tools():
132 """Verify required tools are available."""
133 tools = {
134 "wasm-tools": ["wasm-tools", "--version"],
135 "twiggy": ["twiggy", "--version"],
136 "rustfilt": ["rustfilt", "--version"],
137 "inferno-flamegraph": ["inferno-flamegraph", "--help"],
138 }
139 missing = []
140 for name, cmd in tools.items():
141 try:
142 subprocess.run(cmd, capture_output=True, check=True)
143 except FileNotFoundError:
144 missing.append(name)
145 if missing:
146 print(f"{RED}Error: missing tools: {', '.join(missing)}{RESET}", file=sys.stderr)
147 print(f"Install with: {BOLD}cargo install {' '.join(missing)}{RESET}", file=sys.stderr)
148 sys.exit(1)
149
150
151# ---------------------------------------------------------------------------

Callers 1

mainFunction · 0.85

Calls 5

appendMethod · 0.80
runMethod · 0.65
itemsMethod · 0.45
joinMethod · 0.45
exitMethod · 0.45

Tested by

no test coverage detected