mirror of
https://github.com/maubot/maubot.git
synced 2024-10-01 01:06:10 -04:00
Only include directories with __init__.py when building mbp file
This commit is contained in:
parent
4f68e20ff7
commit
a7f31f6175
@ -93,10 +93,16 @@ def write_plugin(meta: PluginMeta, output: str | IO) -> None:
|
|||||||
if os.path.isfile(f"{module}.py"):
|
if os.path.isfile(f"{module}.py"):
|
||||||
zip.write(f"{module}.py")
|
zip.write(f"{module}.py")
|
||||||
elif module is not None and os.path.isdir(module):
|
elif module is not None and os.path.isdir(module):
|
||||||
|
if os.path.isfile(f"{module}/__init__.py"):
|
||||||
zipdir(zip, module)
|
zipdir(zip, module)
|
||||||
|
else:
|
||||||
|
print(
|
||||||
|
Fore.YELLOW
|
||||||
|
+ f"Module {module} is missing __init__.py, skipping"
|
||||||
|
+ Fore.RESET
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
print(Fore.YELLOW + f"Module {module} not found, skipping" + Fore.RESET)
|
print(Fore.YELLOW + f"Module {module} not found, skipping" + Fore.RESET)
|
||||||
|
|
||||||
for pattern in meta.extra_files:
|
for pattern in meta.extra_files:
|
||||||
for file in glob.iglob(pattern):
|
for file in glob.iglob(pattern):
|
||||||
zip.write(file)
|
zip.write(file)
|
||||||
|
Loading…
Reference in New Issue
Block a user