MCPcopy Create free account
hub / github.com/FastLED/FastLED / run_command

Function run_command

ci/util/elf.py:10–31  ·  view source on GitHub ↗

Run a command using subprocess and capture the output. Args: command (list): Command to run. show_output (bool): Print command and its output if True. Returns: str: Standard output of the command. Raises: RuntimeError: If the command fails.

(command: list[str], show_output: bool = False)

Source from the content-addressed store, hash-verified

8
9
10def run_command(command: list[str], show_output: bool = False) -> str:
11 """
12 Run a command using subprocess and capture the output.
13
14 Args:
15 command (list): Command to run.
16 show_output (bool): Print command and its output if True.
17
18 Returns:
19 str: Standard output of the command.
20
21 Raises:
22 RuntimeError: If the command fails.
23 """
24 if show_output:
25 print(f"Running command: {' '.join(command)}")
26 result = RunningProcess.run(command, cwd=None, check=False, timeout=60)
27 if result.returncode != 0:
28 raise RuntimeError(f"Command failed: {' '.join(command)}\n{result.stdout}")
29 if show_output and result.stdout:
30 print(f"Command output: {result.stdout}")
31 return result.stdout
32
33
34def analyze_elf_file(objdump_path: Path, cppfilt_path: Path, elf_file: Path):

Callers 5

analyze_elf_fileFunction · 0.70
demangle_symbolFunction · 0.70
list_symbols_and_sizesFunction · 0.70
check_elf_formatFunction · 0.70
check_section_contentsFunction · 0.70

Calls 2

printFunction · 0.50
runMethod · 0.45

Tested by

no test coverage detected