mirror of https://github.com/docker/cli.git
cli/command: PromptUserForCredentials: move "post" check for empty name
move the "post" check for username being empty inside the branch
that's handling the username, as it's the only branch where username
is mutated after checking if it's empty.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 581cf36bd4
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
05455f8505
commit
97c25b7574
|
@ -152,10 +152,11 @@ func PromptUserForCredentials(ctx context.Context, cli Cli, argUser, argPassword
|
||||||
if argUser == "" {
|
if argUser == "" {
|
||||||
argUser = defaultUsername
|
argUser = defaultUsername
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if argUser == "" {
|
if argUser == "" {
|
||||||
return registrytypes.AuthConfig{}, errors.Errorf("Error: Non-null Username Required")
|
return registrytypes.AuthConfig{}, errors.Errorf("Error: Non-null Username Required")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if argPassword == "" {
|
if argPassword == "" {
|
||||||
restoreInput, err := DisableInputEcho(cli.In())
|
restoreInput, err := DisableInputEcho(cli.In())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue