Merge "genfileembed: always embed paths with slashes"

This commit is contained in:
Mathieu Lonjaret 2017-12-11 17:40:23 +00:00 committed by Gerrit Code Review
commit 527d42eb03
2 changed files with 6 additions and 2 deletions

View File

@ -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,

View File

@ -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()