mirror of
https://github.com/docker/compose.git
synced 2025-07-03 11:54:27 +02:00
Handle --no-build and --watch args
Signed-off-by: Joana Hrotko <joana.hrotko@docker.com>
This commit is contained in:
parent
4b7b6adc76
commit
dd5614ec3b
@ -137,6 +137,7 @@ func upCommand(p *ProjectOptions, dockerCli command.Cli, backend api.Service, ex
|
|||||||
return upCmd
|
return upCmd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//nolint:gocyclo
|
||||||
func validateFlags(up *upOptions, create *createOptions) error {
|
func validateFlags(up *upOptions, create *createOptions) error {
|
||||||
if up.exitCodeFrom != "" {
|
if up.exitCodeFrom != "" {
|
||||||
up.cascadeStop = true
|
up.cascadeStop = true
|
||||||
@ -159,6 +160,9 @@ func validateFlags(up *upOptions, create *createOptions) error {
|
|||||||
if create.recreateDeps && create.noRecreate {
|
if create.recreateDeps && create.noRecreate {
|
||||||
return fmt.Errorf("--always-recreate-deps and --no-recreate are incompatible")
|
return fmt.Errorf("--always-recreate-deps and --no-recreate are incompatible")
|
||||||
}
|
}
|
||||||
|
if create.noBuild && up.watch {
|
||||||
|
return fmt.Errorf("--no-build and --watch are incompatible")
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -259,6 +259,12 @@ func (lk *LogKeyboard) StartWatch(ctx context.Context, project *types.Project, o
|
|||||||
} else {
|
} else {
|
||||||
eg.Go(tracing.EventWrapFuncForErrGroup(ctx, "menu/watch", tracing.SpanOptions{},
|
eg.Go(tracing.EventWrapFuncForErrGroup(ctx, "menu/watch", tracing.SpanOptions{},
|
||||||
func(ctx context.Context) error {
|
func(ctx context.Context) error {
|
||||||
|
if options.Create.Build == nil {
|
||||||
|
err := fmt.Errorf("Cannot run watch mode with flag --no-build")
|
||||||
|
lk.keyboardError("Watch", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
lk.Watch.newContext(ctx)
|
lk.Watch.newContext(ctx)
|
||||||
buildOpts := *options.Create.Build
|
buildOpts := *options.Create.Build
|
||||||
buildOpts.Quiet = true
|
buildOpts.Quiet = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user