Skip to content

Commit

Permalink
refactored docker args from pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Walsh committed Dec 23, 2023
1 parent 6ab618d commit f82577b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions docs/schema/vimspector.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 <tt>docker run -p 8765:8765 -it simple_python</tt>)."
},
"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.",
Expand Down Expand Up @@ -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."
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions python3/vimspector/debug_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f82577b

Please sign in to comment.