0
0
mirror of https://github.com/thegeeklab/wp-docker-buildx.git synced 2024-11-22 00:00:40 +00:00

Add email to login command when given

This commit is contained in:
Koen Schmeets 2016-06-18 22:56:22 +02:00
parent 87e0bec62f
commit cec1cb5d12

View File

@ -123,6 +123,9 @@ const dockerExe = "/usr/local/bin/docker"
// helper function to create the docker login command.
func commandLogin(login Login) *exec.Cmd {
if p.Login.Email != "" {
return commandLoginEmail(p.Login)
}
return exec.Command(
dockerExe, "login",
"-u", login.Username,
@ -131,6 +134,16 @@ func commandLogin(login Login) *exec.Cmd {
)
}
func commandLoginEmail(p.Login) *exec.Cmd {
return exec.Command(
dockerExe, "login",
"-u", login.Username,
"-p", login.Password,
"-e", login.Email,
login.Registry,
)
}
// helper function to create the docker info command.
func commandVersion() *exec.Cmd {
return exec.Command(dockerExe, "version")