From f47366c659feeea4c085b40c02600a7b9b0e6362 Mon Sep 17 00:00:00 2001 From: Attila Tajti Date: Fri, 8 Dec 2017 09:24:14 +0100 Subject: [PATCH] genfileembed: always embed paths with slashes Also change make.go to propagate -all to genfileembed. Fixes #982 Change-Id: I605d5fc35ae0fc9c12fca639ff0a0111836b653c --- make.go | 6 +++++- pkg/fileembed/genfileembed/genfileembed.go | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/make.go b/make.go index 91fff70b0..879530956 100644 --- a/make.go +++ b/make.go @@ -891,7 +891,11 @@ func genEmbeds() error { } for _, embeds := range []string{"server/camlistored/ui", "pkg/server", "vendor/embed/react", "vendor/embed/less", "vendor/embed/glitch", "vendor/embed/fontawesome", "vendor/embed/leaflet", "app/publisher", "app/scanningcabinet/ui"} { embeds := buildSrcPath(embeds) - args := []string{"--output-files-stderr", embeds} + var args []string + if *all { + args = append(args, "-all") + } + args = append(args, "-output-files-stderr", embeds) cmd := exec.Command(cmdName, args...) cmd.Env = append(cleanGoEnv(), "GOPATH="+buildGoPath, diff --git a/pkg/fileembed/genfileembed/genfileembed.go b/pkg/fileembed/genfileembed/genfileembed.go index 1fb5d53d5..8d5a5ebd9 100644 --- a/pkg/fileembed/genfileembed/genfileembed.go +++ b/pkg/fileembed/genfileembed/genfileembed.go @@ -163,7 +163,7 @@ func main() { fmt.Fprintf(&b, "import \""+*fileEmbedPkgPath+"\"\n\n") b.WriteString(imports) fmt.Fprintf(&b, "func init() {\n\tFiles.Add(%q, %d, time.Unix(0, %d), %s(%s));\n}\n", - fileName, fileSize, fi.ModTime().UnixNano(), byteStreamType, qb) + filepath.ToSlash(fileName), fileSize, fi.ModTime().UnixNano(), byteStreamType, qb) // gofmt it fset := token.NewFileSet()