MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / extract_bash

Function extract_bash

graphify/extractors/bash.py:262–272  ·  view source on GitHub ↗

Extract functions, source imports, and cross-function calls from a .sh file.

(path: Path)

Source from the content-addressed store, hash-verified

260
261
262def extract_bash(path: Path) -> dict:
263 """Extract functions, source imports, and cross-function calls from a .sh file."""
264 try:
265 import tree_sitter_bash as tsbash # noqa: F401
266 except ImportError:
267 return {"nodes": [], "edges": [], "error": "tree-sitter-bash not installed"}
268 try:
269 source = _read_source_bytes(path)
270 except Exception as e:
271 return {"nodes": [], "edges": [], "error": str(e)}
272 return extract_bash_source(source, source_path=path, scan_root=active_scan_root())
273
274
275def extract_bash_source(

Calls 3

_read_source_bytesFunction · 0.90
active_scan_rootFunction · 0.90
extract_bash_sourceFunction · 0.85