fobidden using "npm run dev" in terminal

This commit is contained in:
黄伟韬 2024-10-11 18:39:03 +08:00
parent b81c00a44d
commit 151a17159d
2 changed files with 1 additions and 8 deletions

View file

@ -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:

View file

@ -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):