refactor: explicit check for directory match on -d

This commit is contained in:
Arthur Chaloin
2023-04-12 14:46:44 +02:00
committed by Thibault VINCENT
parent 4a5be1999a
commit cdc2a2cef8
+6
View File
@@ -298,6 +298,12 @@ func (exporter *Exporter) collectMatchingPaths(pattern string, format certificat
return nil, []error{err}
}
// we can get there with no errors and no output if `directories` == true
// and the pattern only evaluates to files
if directories && len(output) == 0 && len(outputErrors) == 0 {
return nil, []error{errors.New("no directory match \"" + pattern + "\"")}
}
return output, outputErrors
}