def METHOD_NAME(command, dir_to_run=None):
    log_text = f"Running {command}"
    if dir_to_run:
        log_text += f" under {dir_to_run}"
    command_out = subprocess.run(shlex.split(command),
                                 cwd=dir_to_run)
    if command_out.returncode != 0:
        error_text = f"Command failed: {command}"
        if dir_to_run:
            error_text += f" (in {dir_to_run})"
        print(error_text)