mirror of
https://github.com/docker/compose.git
synced 2025-07-23 21:54:40 +02:00
Renamed ExecIfDefaultCtxType for more explicit behaviour
This commit is contained in:
parent
3981244701
commit
ab3cd0fec1
@ -101,7 +101,7 @@ func main() {
|
|||||||
SilenceUsage: true,
|
SilenceUsage: true,
|
||||||
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
|
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
|
||||||
if !isOwnCommand(cmd) {
|
if !isOwnCommand(cmd) {
|
||||||
mobycli.Exec(cmd.Context())
|
mobycli.ExecIfDefaultCtxType(cmd.Context())
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
@ -127,7 +127,7 @@ func main() {
|
|||||||
helpFunc := root.HelpFunc()
|
helpFunc := root.HelpFunc()
|
||||||
root.SetHelpFunc(func(cmd *cobra.Command, args []string) {
|
root.SetHelpFunc(func(cmd *cobra.Command, args []string) {
|
||||||
if !isOwnCommand(cmd) {
|
if !isOwnCommand(cmd) {
|
||||||
mobycli.Exec(cmd.Context())
|
mobycli.ExecIfDefaultCtxType(cmd.Context())
|
||||||
}
|
}
|
||||||
helpFunc(cmd, args)
|
helpFunc(cmd, args)
|
||||||
})
|
})
|
||||||
@ -168,7 +168,7 @@ func main() {
|
|||||||
fmt.Fprintln(os.Stderr, err)
|
fmt.Fprintln(os.Stderr, err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
mobycli.Exec(ctx)
|
mobycli.ExecIfDefaultCtxType(ctx)
|
||||||
|
|
||||||
checkIfUnknownCommandExistInDefaultContext(err, currentContext)
|
checkIfUnknownCommandExistInDefaultContext(err, currentContext)
|
||||||
fmt.Fprintln(os.Stderr, err)
|
fmt.Fprintln(os.Stderr, err)
|
||||||
|
@ -16,8 +16,8 @@ import (
|
|||||||
// ComDockerCli name of the classic cli binary
|
// ComDockerCli name of the classic cli binary
|
||||||
const ComDockerCli = "com.docker.cli"
|
const ComDockerCli = "com.docker.cli"
|
||||||
|
|
||||||
// Exec delegates to com.docker.cli if on moby context
|
// ExecIfDefaultCtxType delegates to com.docker.cli if on moby context
|
||||||
func Exec(ctx context.Context) {
|
func ExecIfDefaultCtxType(ctx context.Context) {
|
||||||
currentContext := apicontext.CurrentContext(ctx)
|
currentContext := apicontext.CurrentContext(ctx)
|
||||||
|
|
||||||
s := store.ContextStore(ctx)
|
s := store.ContextStore(ctx)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user