mirror of https://github.com/perkeep/perkeep.git
genfileembed: touch the file modtime, even if contents are same, but it's old
Change-Id: I88d429445da6e251e4aebc0e31017e4ca8f0dd51
This commit is contained in:
parent
593e0f0f81
commit
40e0a86315
|
@ -169,6 +169,7 @@ func main() {
|
|||
func writeFileIfDifferent(filename string, contents []byte) error {
|
||||
fi, err := os.Stat(filename)
|
||||
if err == nil && fi.Size() == int64(len(contents)) && contentsEqual(filename, contents) {
|
||||
os.Chtimes(filename, time.Now(), time.Now())
|
||||
return nil
|
||||
}
|
||||
return ioutil.WriteFile(filename, contents, 0644)
|
||||
|
|
Loading…
Reference in New Issue