Node.JS module to auto include your sub-modules or to generate static include scripts.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
#!/usr/bin/env node
|
|
|
var fs = require('fs');
|
|
|
var automodule = require('automodule');
|
|
|
|
|
|
var modules = automodule({print:true});
|
|
|
|
|
|
if(process.argv.length > 2){
|
|
|
var out = process.argv[2];
|
|
|
if(fs.existsSync(out)){
|
|
|
console.error(out + ' already exists, exiting');
|
|
|
process.exit(1);
|
|
|
}
|
|
|
fs.writeFileSync(out, modules);
|
|
|
} else{
|
|
|
console.log(modules);
|
|
|
}
|