Add a --write and --diff flag; require --write to be set before making any changes, for safety
This commit is contained in:
@@ -16,7 +16,7 @@ type CTLogRootsResponse struct {
|
||||
Certificates []string `json:"certificates"`
|
||||
}
|
||||
|
||||
func generateRoots(args []string) {
|
||||
func generateRoots(args []string, wantDiff bool, allowWrite bool, useColor bool) {
|
||||
sourceURL := "https://rennet2027h2.log.ct.ipng.ch/"
|
||||
outputFile := "roots.pem"
|
||||
|
||||
@@ -107,7 +107,7 @@ func generateRoots(args []string) {
|
||||
}
|
||||
|
||||
// Write all certificates to file with status
|
||||
err = writeFileWithStatus(outputFile, pemBuffer.Bytes())
|
||||
err = writeFileWithStatus(outputFile, pemBuffer.Bytes(), wantDiff, allowWrite, useColor)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to write output file %s: %v", outputFile, err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user