MCPcopy Create free account
hub / github.com/apache/cloudberry / run_command

Function run_command

devops/tools/elf_ubuntu_dependency_analyzer.py:51–65  ·  view source on GitHub ↗

Execute a shell command and return its output. Args: command (list): The command to execute as a list of strings. Returns: str: The output of the command, or None if an error occurred.

(command)

Source from the content-addressed store, hash-verified

49from prettytable import PrettyTable
50
51def run_command(command):
52 """
53 Execute a shell command and return its output.
54
55 Args:
56 command (list): The command to execute as a list of strings.
57
58 Returns:
59 str: The output of the command, or None if an error occurred.
60 """
61 try:
62 return subprocess.check_output(command, stderr=subprocess.STDOUT).decode('utf-8')
63 except subprocess.CalledProcessError as e:
64 print(f"Error running command {' '.join(command)}: {e.output.decode('utf-8').strip()}")
65 return None
66
67def get_package_info(lib_path):
68 """

Callers 3

get_package_infoFunction · 0.70
process_binaryFunction · 0.70
is_elf_binaryFunction · 0.70

Calls 3

stripMethod · 0.80
printFunction · 0.50
joinMethod · 0.45

Tested by

no test coverage detected