summaryrefslogtreecommitdiffstats
path: root/helpers/general.go
diff options
context:
space:
mode:
authorDavid Kassa <david.kassa@gmail.com>2017-01-01 16:16:58 -0600
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-01-01 23:16:58 +0100
commit09a0af94f54a0dbc8900c95ce5c83ee514d8ca68 (patch)
tree671d5351c62f998fbc2e99160463be7a0bb2beec /helpers/general.go
parent6e0f326b9dd3cf60bf87c99c7957c519d0ddd9ef (diff)
Fix Appveyor Windows build and GitInfo path issue on Windows
Diffstat (limited to 'helpers/general.go')
-rw-r--r--helpers/general.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/helpers/general.go b/helpers/general.go
index 1ea08eb25..740c05f5c 100644
--- a/helpers/general.go
+++ b/helpers/general.go
@@ -38,6 +38,11 @@ import (
// FilePathSeparator as defined by os.Separator.
const FilePathSeparator = string(filepath.Separator)
+// Strips carriage returns from third-party / external processes (useful for Windows)
+func normalizeExternalHelperLineFeeds(content []byte) []byte {
+ return bytes.Replace(content, []byte("\r"), []byte(""), -1)
+}
+
// FindAvailablePort returns an available and valid TCP port.
func FindAvailablePort() (*net.TCPAddr, error) {
l, err := net.Listen("tcp", ":0")