Fixed a bug - no panic anymore when logining in without TTY

Fixes #8956

Signed-off-by: Marianna <mtesselh@gmail.com>
This commit is contained in:
Marianna
2014-11-17 19:41:27 -08:00
parent 882db5f885
commit e6fd57b90b
2 changed files with 39 additions and 1 deletions
+4 -1
View File
@@ -289,7 +289,10 @@ func (cli *DockerCli) CmdLogin(args ...string) error {
// the password or email from the config file, so prompt them
if username != authconfig.Username {
if password == "" {
oldState, _ := term.SaveState(cli.inFd)
oldState, err := term.SaveState(cli.inFd)
if err != nil {
return err
}
fmt.Fprintf(cli.out, "Password: ")
term.DisableEcho(cli.inFd, oldState)