Skip to content

Commit

Permalink
Errors on empty command script
Browse files Browse the repository at this point in the history
  • Loading branch information
TekWizely committed Jan 30, 2020
1 parent 53fdc75 commit c0a123e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,11 @@ func tryMatchCmd(ctx *parseContext, p *parser.Parser, config *ast.CmdConfig) boo
// Normalize the script
//
script = runfile.NormalizeCmdScript(script)
// Should not be empty
//
if len(script) == 0 {
panic(parseError(p, "command '"+name+"' contains an empty script."))
}
ctx.ast.Add(&ast.Cmd{Name: name, Config: config, Script: script})
return true
}
Expand Down

0 comments on commit c0a123e

Please sign in to comment.