Skip to content

Commit

Permalink
Fix issue quay#7
Browse files Browse the repository at this point in the history
This patch normalizes the locale settings in utils.Exec to fix parsing issues due to different locales.
  • Loading branch information
lorenz committed Nov 16, 2015
1 parent f229083 commit ad386a2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions utils/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ package utils
import (
"bytes"
"os/exec"
"os"
"strings"
)

// Exec runs the given binary with arguments
Expand All @@ -29,6 +31,17 @@ func Exec(dir string, bin string, args ...string) ([]byte, error) {

cmd := exec.Command(bin, args...)
cmd.Dir = dir

env := os.Environ()
for i, v := range env {
if strings.HasPrefix(v,"LANG=") {
env[i] = "LANG=C"
}
if strings.HasPrefix(v,"LANGUAGE=") {
env[i] = "LANGUAGE=C"
}
}
cmd.Env = env

var buf bytes.Buffer
cmd.Stdout = &buf
Expand Down

0 comments on commit ad386a2

Please sign in to comment.