mirror of
https://github.com/enix/x509-certificate-exporter.git
synced 2026-08-23 22:16:39 +00:00
refactor: explicit check for directory match on -d
This commit is contained in:
committed by
Thibault VINCENT
parent
4a5be1999a
commit
cdc2a2cef8
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user