1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Read the stdin line properly.

Load the auth config before it's used.
This commit is contained in:
David Calavera 2013-09-01 16:12:07 -07:00
parent 35fef275b3
commit ce53e21ea6

View file

@ -277,14 +277,15 @@ func (cli *DockerCli) CmdLogin(args ...string) error {
readInput := func(in io.Reader, out io.Writer) string {
reader := bufio.NewReader(in)
line, err := reader.ReadString('\n')
line, _, err := reader.ReadLine()
if err != nil {
fmt.Fprintln(out, err.Error())
os.Exit(1)
}
return line
return string(line)
}
cli.LoadConfigFile()
authconfig, ok := cli.configFile.Configs[auth.IndexServerAddress()]
if !ok {
authconfig = auth.AuthConfig{}