make output less scary for new files

This commit is contained in:
Christian Goll
2023-02-13 11:11:19 +01:00
parent 7e64e995cb
commit d91f552473

View File

@@ -80,13 +80,13 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
}
fileDesc1, err := os.OpenFile(overlayFile, os.O_RDWR, os.FileMode(PermMode))
if err != nil {
wwlog.Warn("Could not open file for editing: %s", err)
wwlog.Verbose("Files doesn't exist or can't be created: %s", err)
}
defer fileDesc1.Close()
_, _ = fileDesc1.Seek(0, 0)
hasher := sha256.New()
if _, err := io.Copy(hasher, fileDesc1); err != nil {
wwlog.Error("Problems getting checksum of file %s\n", err)
wwlog.Verbose("Problems getting checksum of file %s\n", err)
}
sum1 := hex.EncodeToString(hasher.Sum(nil))
fileDesc1.Close()