Skip to content

Commit

Permalink
Fix appending to Linux exes on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jakob committed Oct 15, 2019
1 parent 48f549f commit 81fde55
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rice/append.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"io"
"os"
"path/filepath"
"runtime"
"strings"
"time"

Expand Down Expand Up @@ -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{
Expand Down

0 comments on commit 81fde55

Please sign in to comment.