tools/android/modularization/owners/owners_git.py
def run_command(command: List[str], cwd: str) -> str:
  '''Runs a command and returns the output.

    Raises an exception and prints the command output if the command fails.'''
  try:
    run_result = subprocess.run(command,
                                capture_output=True,
                                text=True,
                                check=True,
                                cwd=cwd)
  except subprocess.CalledProcessError as e:
    print(f'{command} failed with code {e.returncode}.', file=sys.stderr)
    print(f'\nSTDERR:\n{e.stderr}', file=sys.stderr)
    print(f'\nSTDOUT:\n{e.stdout}', file=sys.stderr)
    raise
  return run_result.stdout.strip()
Runs a command and returns the output.

    Raises an exception and prints the command output if the command fails.
Runs a command and returns the output.
Raises an exception and prints the command output if the command fails.
Runs a command and returns the output . Raises an exception and prints the command output if the command fails .
def run_command(command: List[str], cwd: str) -> str:
  try:
    run_result = subprocess.run(command,
                                capture_output=True,
                                text=True,
                                check=True,
                                cwd=cwd)
  except subprocess.CalledProcessError as e:
    print(f'{command} failed with code {e.returncode}.', file=sys.stderr)
    print(f'\nSTDERR:\n{e.stderr}', file=sys.stderr)
    print(f'\nSTDOUT:\n{e.stdout}', file=sys.stderr)
    raise
  return run_result.stdout.strip()
def run_command ( command : List [ str ] , cwd : str ) -> str : try : run_result = subprocess . run ( command , capture_output = True , text = True , check = True , cwd = cwd ) except subprocess . CalledProcessError as e : print ( f'{command} failed with code {e.returncode}.' , file = sys . stderr ) print ( f'\nSTDERR:\n{e.stderr}' , file = sys . stderr ) print ( f'\nSTDOUT:\n{e.stdout}' , file = sys . stderr ) raise return run_result . stdout . strip ( )
Runs a command and returns the output.
Runs a command and returns the output .
'''Runs a command and returns the output.

    Raises an exception and prints the command output if the command fails.'''
command
List[str]
cwd
str