genfileembed: touch the file modtime, even if contents are same, but it's old

Change-Id: I88d429445da6e251e4aebc0e31017e4ca8f0dd51
This commit is contained in:
Brad Fitzpatrick 2014-02-27 21:00:01 -08:00
parent 593e0f0f81
commit 40e0a86315
1 changed files with 1 additions and 0 deletions

View File

@ -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)