Skip to content

Commit

Permalink
fix(check): plugin check
Browse files Browse the repository at this point in the history
  • Loading branch information
AkashiCoin committed Aug 26, 2024
1 parent aae2fb5 commit 6ebab05
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions scripts/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def default(self, obj):
if not url_path:
logger.error("插件下载地址构建失败...")
exit(1)
asyncio.run(download_file("{github_download_url}".format(url_path)))
asyncio.run(download_file("{github_download_url}".format(url_path), True, "{github_download_url}".split("/contents/")[0] + "/contents/"))
plugin = load_plugin(Path(__file__).parent / "zhenxun"/ "plugins" / "{module_name}")
if not plugin:
Expand Down Expand Up @@ -339,7 +339,7 @@ async def run_poetry_project(self) -> None:
if self.path.exists():
# 默认使用 fake 驱动
with open(self.path / ".env", "w", encoding="utf8") as f:
f.write("DRIVER=fake")
f.write("ENVIRONMENT=dev")
# 如果提供了插件配置项,则写入配置文件
if self.config is not None:
with open(self.path / ".env.prod", "w", encoding="utf8") as f:
Expand Down Expand Up @@ -443,7 +443,6 @@ async def test() -> None:
plugin_github_url = PLUGIN_GITHUB_URL_PATTERN.search(issue_body)
is_dir_text = IS_DIR_PATTERN.search(issue_body)
config = CONFIG_PATTERN.search(issue_body)
print(plugin_name, module_name, module_path, plugin_github_url, is_dir_text, config)

if not (
plugin_name
Expand Down Expand Up @@ -535,9 +534,7 @@ async def main():
is_dir=is_dir,
config=config.group(1).strip() if config else None,
)
ok, msg = await test.run()
if ok:
print("测试通过")
await test.run()


if __name__ == "__main__":
Expand Down

0 comments on commit 6ebab05

Please sign in to comment.