Skip to content

Commit ebe809c

Browse files
authored
fix(agents): fix failure to generate dockerfiles on windows (#684)
RE: #683, we should not use `filepath.Join()` to locate embedded dockerfiles, since `embed.FS` uses unix-style path separators on all platrforms. Instead, construct the path manually. See: github.com/golang/go/issues/45230
1 parent 960060b commit ebe809c

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

pkg/agentfs/docker.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"embed"
2020
"fmt"
2121
"os"
22+
"path"
2223
"path/filepath"
2324
"sort"
2425
"strings"
@@ -73,12 +74,16 @@ func GenerateDockerArtifacts(dir string, projectType ProjectType, settingsMap ma
7374
return nil, nil, fmt.Errorf("unable to fetch client settings from server, please try again later")
7475
}
7576

76-
dockerfileContent, err := fs.ReadFile(filepath.Join("examples", string(projectType)+".Dockerfile"))
77+
// NOTE: embed.FS uses unix-style path separators on all platforms, so cannot use filepath.Join here.
78+
// path.Join always uses '/' as the separator.
79+
dockerfileContent, err := fs.ReadFile(path.Join("examples", string(projectType)+".Dockerfile"))
7780
if err != nil {
7881
return nil, nil, err
7982
}
8083

81-
dockerIgnoreContent, err := fs.ReadFile(filepath.Join("examples", string(projectType)+".dockerignore"))
84+
// NOTE: embed.FS uses unix-style path separators on all platforms, so cannot use filepath.Join here
85+
// path.Join always uses '/' as the separator.
86+
dockerIgnoreContent, err := fs.ReadFile(path.Join("examples", string(projectType)+".dockerignore"))
8287
if err != nil {
8388
return nil, nil, err
8489
}

version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
package livekitcli
1616

1717
const (
18-
Version = "2.5.5"
18+
Version = "2.5.6"
1919
)

0 commit comments

Comments
 (0)