From 81fde55784850d9c5479a3de837163d5ef51ffdf Mon Sep 17 00:00:00 2001 From: jakob Date: Tue, 15 Oct 2019 19:47:33 +0200 Subject: [PATCH] Fix appending to Linux exes on Windows --- rice/append.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rice/append.go b/rice/append.go index 80ab109..8a664ae 100644 --- a/rice/append.go +++ b/rice/append.go @@ -7,6 +7,7 @@ import ( "io" "os" "path/filepath" + "runtime" "strings" "time" @@ -85,6 +86,10 @@ func operationAppend(pkgs []*build.Package) { } // create zipFilename zipFileName := filepath.Join(appendedBoxName, strings.TrimPrefix(path, boxPath)) + if runtime.GOOS == "windows" { + // allow appending to linux executables on windows + zipFileName = strings.Replace(zipFileName, `\`, `/`, -1) + } // write directories as empty file with comment "dir" if info.IsDir() { header := &zip.FileHeader{