Skip to content

Commit

Permalink
invert the file check logic
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammadn authored and npdgm committed Dec 10, 2024
1 parent c62dad7 commit 1052baa
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions internal/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,13 @@ func (exporter *Exporter) collectMatchingPaths(pattern string, format certificat
continue
}
} else {
if strings.HasSuffix(file.Name(), ".key") {
continue
}

format = certificateFormatPEM
if strings.HasSuffix(file.Name(), ".crt") ||
strings.HasSuffix(file.Name(), ".pem") ||
strings.HasSuffix(file.Name(), ".cert") {
format = certificateFormatPEM
} else {
continue
}
}

output = append(output, &certificateRef{
Expand Down

0 comments on commit 1052baa

Please sign in to comment.