summaryrefslogtreecommitdiff
path: root/bin/lazy-update.js
blob: 0f3ea81ac565b0c36d220c79d7081ff1f63f834a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
var fs = require('fs');

module.exports = function(file, content) {
    try {
        var existing = fs.readFileSync(file, 'utf8');
        if (existing != content) {
            fs.writeFileSync(file, content);
        }
    } catch(err) {
        fs.writeFileSync(file, content);
    }
};