force file mode on write (and update deps)

This commit is contained in:
Mikaël Cluseau
2020-10-02 05:57:38 +02:00
parent b7218a009f
commit 2ad5dd5dfc
10 changed files with 269 additions and 26 deletions

View File

@ -66,7 +66,8 @@ func Files(cfg *config.Config, filters ...string) (err error) {
)
if err != nil {
return
log.Print("failed to write file ", file.Path, ": ", err)
continue
}
}
@ -85,5 +86,9 @@ func writeFile(path string, content []byte, fileMode, dirMode os.FileMode, cfg *
err = fmt.Errorf("failed to write %s: %v", path, err)
}
if chmodErr := os.Chmod(path, fileMode); chmodErr != nil {
log.Print("- failed chmod: ", chmodErr)
}
return
}