This commit is contained in:
黄伟韬 2024-10-12 16:33:40 +08:00
parent 253853ef8e
commit b9cfc29e31
3 changed files with 4 additions and 5 deletions

View file

@ -141,8 +141,7 @@ class Engineer2(RoleZero):
return f"The file {path} has been successfully created, with content:\n{code}"
def deploy_to_public(self, dist_dir):
"""fix the path to absolute path"""
# fix the path according to the editor's working directory
"""fix the dist_dir path to absolute path before deploying"""
dist_dir = self.editor._try_fix_path(dist_dir)
return self.deployer.deploy_to_public(dist_dir)

View file

@ -12,7 +12,7 @@ class Deployer:
async def static_server(self, src_path: str) -> str:
"""This function will be implemented in the remote service."""
return f"http://127.0.0.1:{8000}/index.html"
return "http://127.0.0.1:8000/index.html"
async def deploy_to_public(self, dist_dir: str):
"""

View file

@ -68,10 +68,10 @@ class Terminal:
output = ""
# Remove forbidden commands
for cmd_name, reason in self.forbidden_commands.items():
# 'true' is a pass command in linux terminal.
# "true" is a pass command in linux terminal.
if cmd_name in cmd:
cmd = cmd.replace(cmd_name, "true")
output += f"{cmd_name} is failed to executed. {reason}\n"
output += f"Failed to execut {cmd_name}. {reason}\n"
# Send the command
self.process.stdin.write((cmd + self.command_terminator).encode())