File tree Expand file tree Collapse file tree
internal/pkg/devcontainers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,6 +59,17 @@ func ListDevcontainers() ([]DevcontainerInfo, error) {
5959 for scanner .Scan () {
6060 line := scanner .Text ()
6161 parts := strings .Split (line , "|" )
62+ localPath := parts [listPartLocalFolder ]
63+ if localPath == "" {
64+ // not a dev container
65+ continue
66+ }
67+ if wsl .HasWslPathPrefix (localPath ) && wsl .IsWsl () {
68+ localPath , err = wsl .ConvertWindowsPathToWslPath (localPath )
69+ if err != nil {
70+ return []DevcontainerInfo {}, fmt .Errorf ("error converting path: %s" , err )
71+ }
72+ }
6273 name := parts [listPartLocalFolder ]
6374 if name == "" {
6475 // No local folder => use dockercompose parts
@@ -69,13 +80,6 @@ func ListDevcontainers() ([]DevcontainerInfo, error) {
6980 name = name [index + 1 :]
7081 }
7182 }
72- localPath := parts [listPartLocalFolder ]
73- if wsl .HasWslPathPrefix (localPath ) && wsl .IsWsl () {
74- localPath , err = wsl .ConvertWindowsPathToWslPath (localPath )
75- if err != nil {
76- return []DevcontainerInfo {}, fmt .Errorf ("error converting path: %s" , err )
77- }
78- }
7983 devcontainer := DevcontainerInfo {
8084 ContainerID : parts [listPartID ],
8185 ContainerName : parts [listPartContainerName ],
You can’t perform that action at this time.
0 commit comments