import os
import bpy
path_to_script_dir = os.getcwd() + "/assets/blender/scripts/addons/" + str(bpy.app.version[0]) + "." + str(bpy.app.version[1])
file_list = sorted(os.listdir(path_to_script_dir))
script_list = [item for item in file_list if item.endswith('.zip')]
for file in file_list:
    path_to_file = os.path.join(path_to_script_dir, file)
    bpy.ops.preferences.addon_install(overwrite=True, target='DEFAULT', filepath=path_to_file, filter_folder=True, filter_python=False, filter_glob="*.py;*.zip")
enableTheseAddons = ["VRM_Addon_for_Blender-release", "io_ogre"]
for string in enableTheseAddons:
    name = enableTheseAddons
    bpy.ops.preferences.addon_enable(module = string)
bpy.ops.wm.save_userpref()

