File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -428,6 +428,8 @@ func buildVSCodeWorkspaceDevContainerLink(
428
428
containerName string ,
429
429
containerFolder string ,
430
430
) (* url.URL , url.Values ) {
431
+ containerFolder = windowsToUnixPath (containerFolder )
432
+
431
433
qp := url.Values {}
432
434
qp .Add ("url" , clientURL )
433
435
qp .Add ("owner" , workspace .OwnerName )
@@ -520,6 +522,10 @@ func unixToWindowsPath(p string) string {
520
522
return strings .ReplaceAll (p , "/" , "\\ " )
521
523
}
522
524
525
+ func windowsToUnixPath (p string ) string {
526
+ return strings .ReplaceAll (p , "\\ " , "/" )
527
+ }
528
+
523
529
// resolveAgentAbsPath resolves the absolute path to a file or directory in the
524
530
// workspace. If the path is relative, it will be resolved relative to the
525
531
// workspace's expanded directory. If the path is absolute, it will be returned
Original file line number Diff line number Diff line change @@ -185,11 +185,6 @@ func TestOpenVSCode_NoAgentDirectory(t *testing.T) {
185
185
wd , err := os .Getwd ()
186
186
require .NoError (t , err )
187
187
188
- absPath := "/home/coder"
189
- if runtime .GOOS == "windows" {
190
- absPath = "C:\\ home\\ coder"
191
- }
192
-
193
188
tests := []struct {
194
189
name string
195
190
args []string
@@ -210,8 +205,8 @@ func TestOpenVSCode_NoAgentDirectory(t *testing.T) {
210
205
},
211
206
{
212
207
name : "ok with absolute path" ,
213
- args : []string {"--test.open-error" , workspace .Name , absPath },
214
- wantDir : absPath ,
208
+ args : []string {"--test.open-error" , workspace .Name , "/home/coder" },
209
+ wantDir : "/home/coder" ,
215
210
},
216
211
{
217
212
name : "ok with token" ,
You can’t perform that action at this time.
0 commit comments