Browse Source

Hard code file mode on disk write to 0644 which is what we would expect

master
KemoNine 8 months ago
parent
commit
0c9bfd6a7c
  1. 6
      utils/files.go

6
utils/files.go

@ -7,11 +7,7 @@ import (
)
func WriteFile(destinationPath string, tempPath string, dataForDisk []byte) {
existingStat, err := os.Lstat(destinationPath)
if err != nil {
log.Fatalf("Error checking if file exists : %s", err)
}
if err := ioutil.WriteFile(tempPath, dataForDisk, existingStat.Mode()); err != nil {
if err := ioutil.WriteFile(tempPath, dataForDisk, 0644); err != nil {
log.Fatalf("Error writing temp file : %s", err)
}
if err := os.Rename(tempPath, destinationPath); err != nil {

Loading…
Cancel
Save