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 {
|
readInput := func(in io.Reader, out io.Writer) string {
|
||||||
reader := bufio.NewReader(in)
|
reader := bufio.NewReader(in)
|
||||||
line, err := reader.ReadString('\n')
|
line, _, err := reader.ReadLine()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintln(out, err.Error())
|
fmt.Fprintln(out, err.Error())
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
return line
|
return string(line)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cli.LoadConfigFile()
|
||||||
authconfig, ok := cli.configFile.Configs[auth.IndexServerAddress()]
|
authconfig, ok := cli.configFile.Configs[auth.IndexServerAddress()]
|
||||||
if !ok {
|
if !ok {
|
||||||
authconfig = auth.AuthConfig{}
|
authconfig = auth.AuthConfig{}
|
||||||
|
|
Loading…
Add table
Reference in a new issue