Skip to content

Commit 154e966

Browse files
author
gy2006
committed
fix empty script check
1 parent e0e35ac commit 154e966

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

executor/executor.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,15 @@ func (b *BaseExecutor) getScripts() []string {
223223
scripts = b.inCmd.Pwsh
224224
}
225225

226-
if len(scripts) == 0 {
227-
panic(fmt.Errorf("agent: the cmd missing shell script"))
226+
isAllEmpty := true
227+
for _, script := range scripts {
228+
if !util.IsEmptyString(script) {
229+
isAllEmpty = false
230+
}
231+
}
232+
233+
if isAllEmpty {
234+
panic(fmt.Errorf("agent: Missing bash or pwsh section in flow YAML"))
228235
}
229236

230237
return scripts

0 commit comments

Comments
 (0)