Skip to content

Commit

Permalink
Merge pull request #8788 from debdutdeb/8784-timeout-param
Browse files Browse the repository at this point in the history
Fix compose down --timeout/-t flag
  • Loading branch information
mat007 authored Oct 19, 2021
2 parents d48068d + 55a214a commit 555b0ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions cmd/compose/down.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@ func downCommand(p *projectOptions, backend api.Service) *cobra.Command {
downCmd := &cobra.Command{
Use: "down",
Short: "Stop and remove containers, networks",
PreRun: func(cmd *cobra.Command, args []string) {
PreRunE: AdaptCmd(func(ctx context.Context, cmd *cobra.Command, args []string) error {
opts.timeChanged = cmd.Flags().Changed("timeout")
},
PreRunE: Adapt(func(ctx context.Context, args []string) error {
if opts.images != "" {
if opts.images != "all" && opts.images != "local" {
return fmt.Errorf("invalid value for --rmi: %q", opts.images)
Expand Down
4 changes: 1 addition & 3 deletions cmd/compose/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,8 @@ func upCommand(p *projectOptions, backend api.Service) *cobra.Command {
upCmd := &cobra.Command{
Use: "up [SERVICE...]",
Short: "Create and start containers",
PreRun: func(cmd *cobra.Command, args []string) {
PreRunE: AdaptCmd(func(ctx context.Context, cmd *cobra.Command, args []string) error {
create.timeChanged = cmd.Flags().Changed("timeout")
},
PreRunE: Adapt(func(ctx context.Context, args []string) error {
if up.exitCodeFrom != "" {
up.cascadeStop = true
}
Expand Down

0 comments on commit 555b0ab

Please sign in to comment.