File tree 3 files changed +17
-25
lines changed
3 files changed +17
-25
lines changed Original file line number Diff line number Diff line change @@ -123,23 +123,25 @@ func (r *RootCmd) openVSCode() *serpent.Command {
123
123
var foundContainer bool
124
124
125
125
for _ , container := range containers .Containers {
126
- if container .FriendlyName == containerName {
127
- foundContainer = true
128
-
129
- if directory == "" {
130
- localFolder , ok := container .Labels ["devcontainer.local_folder" ]
131
- if ! ok {
132
- return xerrors .New ("container missing `devcontainer.local_folder` label" )
133
- }
134
-
135
- directory , ok = container .Volumes [localFolder ]
136
- if ! ok {
137
- return xerrors .New ("container missing volume for `devcontainer.local_folder`" )
138
- }
126
+ if container .FriendlyName != containerName {
127
+ continue
128
+ }
129
+
130
+ foundContainer = true
131
+
132
+ if directory == "" {
133
+ localFolder , ok := container .Labels ["devcontainer.local_folder" ]
134
+ if ! ok {
135
+ return xerrors .New ("container missing `devcontainer.local_folder` label" )
139
136
}
140
137
141
- break
138
+ directory , ok = container .Volumes [localFolder ]
139
+ if ! ok {
140
+ return xerrors .New ("container missing volume for `devcontainer.local_folder`" )
141
+ }
142
142
}
143
+
144
+ break
143
145
}
144
146
145
147
if ! foundContainer {
@@ -250,6 +252,7 @@ func (r *RootCmd) openVSCode() *serpent.Command {
250
252
FlagShorthand : "c" ,
251
253
Description : "Container name to connect to in the workspace." ,
252
254
Value : serpent .StringOf (& containerName ),
255
+ Hidden : true , // Hidden until this features is at least in beta.
253
256
},
254
257
{
255
258
Flag : "test.open-error" ,
Original file line number Diff line number Diff line change 6
6
Open a workspace in VS Code Desktop
7
7
8
8
OPTIONS:
9
- -c, --container string
10
- Container name to connect to in the workspace.
11
-
12
9
--generate-token bool, $CODER_OPEN_VSCODE_GENERATE_TOKEN
13
10
Generate an auth token and include it in the vscode:// URI. This is
14
11
for automagical configuration of VS Code Desktop and not needed if
You can’t perform that action at this time.
0 commit comments