Skip to content

Commit

Permalink
env type file must use name field
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelsq committed Dec 14, 2020
1 parent a4692ca commit edb8220
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/wtc/wtc.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,11 @@ func trig(rule *Rule, pkg, path string) error {
keys[pieces[0]] = pieces[1]
}
for _, e := range append(config.Env, rule.Env...) {
if e.Type == "file" {
if strings.ToLower(e.Type) == "file" {
if e.Name == "" {
panic(fmt.Errorf("field \"name\" must point to a file"))
}

var body string
{
fileInfo, err := os.Stat(e.Name)
Expand Down

0 comments on commit edb8220

Please sign in to comment.