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:
parent
35fef275b3
commit
ce53e21ea6
1 changed files with 3 additions and 2 deletions
|
@ -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{}
|
||||
|
|
Loading…
Add table
Reference in a new issue