def METHOD_NAME(directory, target):
    asset_base = os.path.join(os.path.dirname(os.path.realpath(__file__)), "assets")
    # header
    shutil.copy(os.path.join(asset_base, "header.py"), target)
    # zip file
    buffer = io.BytesIO()
    archive = zipfile.ZipFile(buffer, "a")
    for root, dirs, files in os.walk(directory):
        for f in files:
            source = os.path.join(root, f)
            archive_fname = source.split(directory)[1]
            archive.write(source, archive_fname)
    if "DEBUG" in os.environ:
        print(archive.namelist())
    archive.close()
    with open(target, "ab") as bytes_out:
        encoded = b64encode(buffer.getvalue())
        for section in bytes_slicer(64, encoded):
            bytes_out.write(TAG)
            bytes_out.write(section)
            bytes_out.write(b"\n")