Skip to content

Commit

Permalink
fix: validate if command is specified (#1295)
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-shunsuke authored Jun 2, 2024
1 parent 92531b2 commit 7a487f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/controller/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ import (

// Apply sends the notification with notifier
func (ctrl *Controller) Apply(ctx context.Context, command Command) error {
if command.Cmd == "" {
return errors.New("no command specified")
}
if err := platform.Complement(&ctrl.Config); err != nil {
return err
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/controller/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ import (

// Plan sends the notification with notifier
func (ctrl *Controller) Plan(ctx context.Context, command Command) error {
if command.Cmd == "" {
return errors.New("no command specified")
}
if err := platform.Complement(&ctrl.Config); err != nil {
return err
}
Expand Down

0 comments on commit 7a487f0

Please sign in to comment.