Tweak build option internals and add test template files.

Former-commit-id: ed5ec6ed7886a066c8c727de19dc0fe6548a276d
This commit is contained in:
John-David Dalton
2012-09-30 00:57:09 -07:00
parent 65ab5fdb34
commit 463b5c6e49
7 changed files with 70 additions and 32 deletions

View File

@@ -56,13 +56,16 @@
// expose `postprocess`
if (module != require.main) {
module.exports = postprocess;
} else {
}
else {
// read the Lo-Dash source file from the first argument if the script
// was invoked directly (e.g. `node post-compile.js source.js`) and write to
// the same file
(function() {
var source = fs.readFileSync(process.argv[2], 'utf8');
fs.writeFileSync(process.argv[2], postprocess(source), 'utf8');
var filePath = process.argv[2],
source = fs.readFileSync(filePath, 'utf8');
fs.writeFileSync(filePath, postprocess(source), 'utf8');
}());
}
}());