Parse examples and build external modules on install

This commit is contained in:
Tim Schaub
2014-10-23 13:30:51 -06:00
parent 01b64bc655
commit 4785001548
8 changed files with 55 additions and 14 deletions

View File

@@ -137,14 +137,25 @@ function writeExampleList(exampleInfos, callback) {
/**
* List examples, parse them, and write example list.
* @param {function(Error)} callback Called with any error.
*/
async.waterfall([
listExamples,
parseExamples,
writeExampleList
], function(err) {
if (err) {
process.stderr.write(err + '\n');
process.exit(1);
}
});
function main(callback) {
async.waterfall([
listExamples,
parseExamples,
writeExampleList
], callback);
}
if (require.main === module) {
main(function(err) {
if (err) {
process.stderr.write(err.message + '\n');
process.exit(1);
} else {
process.exit(0);
}
});
}
module.exports = main;