Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove line carriages on asset generation #8464

Merged
merged 3 commits into from
Sep 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG-developer.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ The list below covers the major changes between 6.3.0 and master only.

- Fix permissions of generated Filebeat filesets. {pull}7140[7140]
- Collect fields from _meta/fields.yml too. {pull}8397[8397]
- Fix issue on asset generation that could lead to different results in Windows. {pull}8464[8464]

==== Added

Expand Down
5 changes: 4 additions & 1 deletion dev-tools/cmd/asset/asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"go/format"
"io/ioutil"
"os"
"strings"

"github.com/elastic/beats/libbeat/asset"
"github.com/elastic/beats/licenses"
Expand Down Expand Up @@ -79,7 +80,9 @@ func main() {
}
}

encData, err := asset.EncodeData(string(data))
// Depending on OS or tools configuration, files can contain carriages (\r),
// what leads to different results, remove them before encoding.
encData, err := asset.EncodeData(strings.Replace(string(data), "\r", "", -1))
jsoriano marked this conversation as resolved.
Show resolved Hide resolved
if err != nil {
fmt.Fprintf(os.Stderr, "Error encoding the data: %s\n", err)
os.Exit(1)
Expand Down