Skip to content

Commit

Permalink
Fixed regression in build script
Browse files Browse the repository at this point in the history
We shouldn't convert shell script line endings to CRLF.
  • Loading branch information
pgaskin committed Sep 22, 2019
1 parent abc7ed2 commit 9c6b943
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,11 @@ func build(srcdir, dldir, outdir, kpver, version string, kpbin []string) error {
}

buf = bytes.ReplaceAll(buf, []byte("{{version}}"), []byte(version))
buf = bytes.ReplaceAll(buf, []byte{'\r'}, []byte{}) // convert dos to unix in case it is already dos
buf = bytes.ReplaceAll(buf, []byte{'\n'}, []byte{'\r', '\n'}) // and then back to dos again

if filepath.Ext(relpath) != ".sh" {
buf = bytes.ReplaceAll(buf, []byte{'\r'}, []byte{}) // convert dos to unix in case it is already dos
buf = bytes.ReplaceAll(buf, []byte{'\n'}, []byte{'\r', '\n'}) // and then back to dos again
}

zh := &zip.FileHeader{
Name: relpath,
Expand Down

0 comments on commit 9c6b943

Please sign in to comment.