From f82577b6655d15b54bc88e7ac220369d90190ada Mon Sep 17 00:00:00 2001 From: Jordan Walsh Date: Fri, 22 Dec 2023 20:06:04 -0500 Subject: [PATCH] refactored docker args from pr feedback --- docs/schema/vimspector.schema.json | 9 +++++---- python3/vimspector/debug_session.py | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/schema/vimspector.schema.json b/docs/schema/vimspector.schema.json index 23f00648..6445d577 100644 --- a/docs/schema/vimspector.schema.json +++ b/docs/schema/vimspector.schema.json @@ -113,6 +113,11 @@ "type": "string", "description": "Name or container id of the docker run container to connect to (via docker exec). Note the container must already be running (Vimspector will not start it) and it must have the port forwarded to the host if subsequently connecting via a port (for example docker run -p 8765:8765 -it simple_python)." }, + "docker_args": { + "type": "array", + "items": {"type": "string"}, + "description": "Extra command line args to pass to docker exec." + }, "ssh": { "type": "object", "description": "Optional to customize the ssh client and its arguments to execute for remote-launch or remote-attach.", @@ -186,10 +191,6 @@ "type": "array", "items": { "type": "string" }, "description": "A single command to execute for remote-launch. Like runCommands but for a single command." - }, - "workdir": { - "type": "string", - "description": "For containers. The value passed to docker exec for the working directory." } } } diff --git a/python3/vimspector/debug_session.py b/python3/vimspector/debug_session.py index a1c367f1..4562ee90 100644 --- a/python3/vimspector/debug_session.py +++ b/python3/vimspector/debug_session.py @@ -1684,8 +1684,8 @@ def _GetShellCommand( self ): def _GetDockerCommand( self, remote ): docker = [ 'docker', 'exec', '-t' ] - if 'workdir' in remote: - docker.extend(["-w", remote['workdir']]) + if 'docker_args' in remote: + docker += remote['docker_args'] docker.append( remote[ 'container' ] ) return docker