allocate writeFile and backupFile just once

This commit is contained in:
Christian Goll
2025-11-25 09:12:46 +01:00
committed by Jonathon Anderson
parent 983a359c00
commit 0bbab7ac3c
3 changed files with 19 additions and 23 deletions

View File

@@ -91,8 +91,8 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
wwlog.Debug("Found multifile comment, new filename %s", filenameFromTemplate[0][1])
if foundFileComment {
if !Quiet {
wwlog.Info("backupFile: %v", backupFile)
wwlog.Info("writeFile: %v", writeFile)
wwlog.Info("backupFile: %v", *backupFile)
wwlog.Info("writeFile: %v", *writeFile)
wwlog.Info("Filename: %s", destFileName)
}
wwlog.Output("%s", outBuffer.String())
@@ -105,8 +105,8 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
}
}
if !Quiet {
wwlog.Info("backupFile: %v", backupFile)
wwlog.Info("writeFile: %v", writeFile)
wwlog.Info("backupFile: %v", *backupFile)
wwlog.Info("writeFile: %v", *writeFile)
wwlog.Info("Filename: %s", destFileName)
}
wwlog.Output("%s", outBuffer.String())