From 151a17159d29faa54b73b80a10473f5e18b6d5e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E4=BC=9F=E9=9F=AC?= Date: Fri, 11 Oct 2024 18:39:03 +0800 Subject: [PATCH] fobidden using "npm run dev" in terminal --- metagpt/roles/di/role_zero.py | 2 +- metagpt/tools/libs/deployer.py | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/metagpt/roles/di/role_zero.py b/metagpt/roles/di/role_zero.py index d4c77630c..041990372 100644 --- a/metagpt/roles/di/role_zero.py +++ b/metagpt/roles/di/role_zero.py @@ -546,7 +546,7 @@ class RoleZero(Role): elif cmd["command_name"] == "Terminal.run_command": if "npm run dev" in cmd["args"]: command_output = "command run failed! Pleae use Delopyer to deploy your project after build." - + return command_output tool_obj = self.tool_execution_map[cmd["command_name"]] tool_output = await tool_obj(**cmd["args"]) if len(tool_output) <= 10: diff --git a/metagpt/tools/libs/deployer.py b/metagpt/tools/libs/deployer.py index 85f06695b..4f1ac0ecf 100644 --- a/metagpt/tools/libs/deployer.py +++ b/metagpt/tools/libs/deployer.py @@ -12,13 +12,6 @@ class Deployer: async def static_server(self, src_path: str) -> str: """This function will be implemented in the remote service.""" - # app = aiohttp.web.Application() - # app.router.add_static('/', src_path, show_index=True) - # runner = aiohttp.web.AppRunner(app) - # await runner.setup() - # site = aiohttp.web.TCPSite(runner, "127.0.0.1", 0) - # await site.start() - # port = site._server.sockets[0].getsockname()[1] return f"http://127.0.0.1:{8000}/index.html" async def deploy_to_public(self, dist_dir: str):