Skip to content

Commit aa27433

Browse files
committed
add error for empty command
1 parent fd20628 commit aa27433

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

service/task/target.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package task
22

33
import (
4+
"errors"
45
"fmt"
56
"os"
67
"os/exec"
@@ -53,7 +54,7 @@ func (t *Target) Execute(dir string, env map[string]string, shutdown bool) (err
5354

5455
func execute(dir string, env map[string]string, command []string) (err error) {
5556
if len(command) == 0 {
56-
return
57+
return errors.New("attempt to execute target with empty command")
5758
}
5859

5960
cmd := exec.Command(command[0])

0 commit comments

Comments
 (0)