mirror of
https://github.com/docker/compose.git
synced 2026-08-27 03:45:29 +00:00
Move login to root command, delegate to classic login when only one arg and not dot in it
This commit is contained in:
parent
f1fb80ecc5
commit
e2b9f5bc57
8 changed files with 104 additions and 43 deletions
|
|
@ -6,11 +6,13 @@ import (
|
|||
"os"
|
||||
"os/exec"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
apicontext "github.com/docker/api/context"
|
||||
"github.com/docker/api/context/store"
|
||||
)
|
||||
|
||||
// Exec will delegate the cli command to docker-classic
|
||||
// Exec delegates to docker-classic
|
||||
func Exec(ctx context.Context) {
|
||||
currentContext := apicontext.CurrentContext(ctx)
|
||||
s := store.ContextStore(ctx)
|
||||
|
|
@ -34,3 +36,9 @@ func Exec(ctx context.Context) {
|
|||
os.Exit(0)
|
||||
}
|
||||
}
|
||||
|
||||
// ExecCmd delegates the cli command to docker-classic. The error is never returned (process will exit with docker classic exit code), the return type is to make it easier to use with cobra commands
|
||||
func ExecCmd(command *cobra.Command) error {
|
||||
Exec(command.Context())
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue