Skip to content

Commit

Permalink
Merge pull request #10143 from cpuguy83/10129_marshal-indent_dockercfg
Browse files Browse the repository at this point in the history
Make .dockercfg with json.MarshallIndent
  • Loading branch information
Jessie Frazelle committed Jan 17, 2015
2 parents 4245952 + b8f7526 commit 467b7c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
14 changes: 2 additions & 12 deletions integration-cli/docker_cli_login_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,15 @@ package main

import (
"bytes"
"io"
"os/exec"
"testing"
)

func TestLoginWithoutTTY(t *testing.T) {
cmd := exec.Command(dockerBinary, "login")

// create a buffer with text then a new line as a return
buf := bytes.NewBuffer([]byte("buffer test string \n"))

// use a pipe for stdin and manually copy the data so that
// the process does not get the TTY
in, err := cmd.StdinPipe()
if err != nil {
t.Fatal(err)
}
// copy the bytes into the commands stdin along with a new line
go io.Copy(in, buf)
// Send to stdin so the process does not get the TTY
cmd.Stdin = bytes.NewBufferString("buffer test string \n")

// run the command and block until it's done
if err := cmd.Run(); err == nil {
Expand Down
2 changes: 1 addition & 1 deletion registry/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func SaveConfig(configFile *ConfigFile) error {
configs[k] = authCopy
}

b, err := json.Marshal(configs)
b, err := json.MarshalIndent(configs, "", "\t")
if err != nil {
return err
}
Expand Down

0 comments on commit 467b7c8

Please sign in to comment.