Skip to content

Commit e1969ca

Browse files
committed
fix: error if CLI glob expansion fails
1 parent 8fdbc63 commit e1969ca

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

engine/engine.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,11 +394,15 @@ func (e *Engine) Build(outputs []string) error {
394394
func (e *Engine) expandOutputs(outputs []string) ([]string, error) {
395395
expanded := []string{}
396396
for _, output := range outputs {
397-
glob, err := e.normalisePath(output)
397+
normalised, err := e.normalisePath(output)
398398
if err != nil {
399399
return nil, err
400400
}
401-
expanded = append(expanded, e.globber.MatchFilesystem(glob)...)
401+
globbed := e.globber.MatchFilesystem(normalised)
402+
if len(globbed) == 0 {
403+
return nil, fmt.Errorf("no matching outputs for %q", normalised)
404+
}
405+
expanded = append(expanded, globbed...)
402406
}
403407
return expanded, nil
404408
}

0 commit comments

Comments
 (0)