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)
| 49 | from prettytable import PrettyTable |
| 50 | |
| 51 | def 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 | |
| 67 | def get_package_info(lib_path): |
| 68 | """ |
no test coverage detected