Skip to content

Commit

Permalink
Make GetClientArch silent on command line
Browse files Browse the repository at this point in the history
This turns off StreamStdio where the output was streamed
directly to STDIO.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Jun 7, 2020
1 parent bda94d0 commit 629c0bc
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions pkg/env/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,25 @@ import (

// GetClientArch returns a pair of arch and os
func GetClientArch() (string, string) {
task := execute.ExecTask{Command: "uname", Args: []string{"-m"}, StreamStdio: false}
task := execute.ExecTask{
Command: "uname",
Args: []string{"-m"},
StreamStdio: false,
}

res, err := task.Execute()
if err != nil {
log.Println(err)
}

arch := strings.TrimSpace(res.Stdout)

taskOS := execute.ExecTask{Command: "uname", Args: []string{"-s"}, StreamStdio: false}
taskOS := execute.ExecTask{
Command: "uname",
Args: []string{"-s"},
StreamStdio: false,
}

resOS, errOS := taskOS.Execute()
if errOS != nil {
log.Println(errOS)
Expand Down

0 comments on commit 629c0bc

Please sign in to comment.