from typing import List


def build_packer_command(
    packer_cmd: str, var_files: str, pr_var_file: str, template: str
) -> List[str]:
    """
    Build the array of arguments needed to invoke packer.
    """

    command = [packer_cmd, "build"]
    for filename in var_files:
        command.append(f"-var-file={filename}")
    command.append(f"-var-file={pr_var_file}")
    command.append(template)
    return command