awtk/tools/idl_gen/index.js
2020-04-28 09:34:09 +08:00

23 lines
566 B
JavaScript

const fs = require('fs');
const path = require('path');
const glob = require('glob')
const IDLGen = require('./idl_gen.js')
let outputIDL = 'idl.json';
let sourcesPath = path.normalize(path.join(__dirname, '../../src'));
if(process.argv.length == 3) {
outputIDL = process.argv[2];
} else if(process.argv.length > 3) {
outputIDL = process.argv[2];
sourcesPath = process.argv[3];
}
if(sourcesPath === '-h' || sourcesPath === '--help') {
console.log('Usage: node index.js outputIDL sourcesPath');
process.exit(0);
}
IDLGen.gen(sourcesPath, outputIDL)