Fix rewriting of declaration.js causing all files to be relinted with every change.
This commit is contained in:
parent
d5b7ab2bc1
commit
487285428e
6
Makefile
6
Makefile
@ -117,8 +117,12 @@ tmp/font-awesome.css : src/css/font-awesome.css $(imports_font_awesome) $(templa
|
||||
tmp/style.css : src/css/style.css $(imports_style) $(template_deps) | tmp
|
||||
$(template) $< $@
|
||||
|
||||
tmp/declaration.js : $(wildcard src/*/*.coffee) tools/declare.js | tmp
|
||||
.events/declare : $(wildcard src/*/*.coffee) tools/declare.js | .events tmp
|
||||
node tools/declare.js
|
||||
echo -> $@
|
||||
|
||||
tmp/declaration.js : .events/declare
|
||||
|
||||
|
||||
tmp/globals.js : src/General/globals.js version.json $(template_deps) | tmp
|
||||
$(template) $< $@
|
||||
|
||||
@ -7,4 +7,12 @@ for (var d of fs.readdirSync('src')) {
|
||||
if (m) names.push(m[1]);
|
||||
}
|
||||
}
|
||||
fs.writeFileSync('tmp/declaration.js', `var ${names.sort().join(', ')};\n`);
|
||||
var decl = `var ${names.sort().join(', ')};\n`;
|
||||
var oldDecl;
|
||||
try {
|
||||
oldDecl = fs.readFileSync('tmp/declaration.js', 'utf8');
|
||||
} catch(err) {
|
||||
}
|
||||
if (decl !== oldDecl) {
|
||||
fs.writeFileSync('tmp/declaration.js', decl, 'utf8');
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user