2020-01-02 10:12:42 +08:00
|
|
|
|
const fs = require('fs');
|
2019-05-08 11:26:58 +08:00
|
|
|
|
const path = require('path');
|
2018-08-05 11:49:47 +08:00
|
|
|
|
const glob = require('glob')
|
2020-01-02 10:12:42 +08:00
|
|
|
|
const IDLGen = require('./idl_gen.js')
|
2018-08-05 11:49:47 +08:00
|
|
|
|
|
2019-05-08 15:42:13 +08:00
|
|
|
|
let outputIDL = 'idl.json';
|
|
|
|
|
let sourcesPath = path.normalize(path.join(__dirname, '../../src'));
|
2019-05-08 11:26:58 +08:00
|
|
|
|
|
|
|
|
|
if(process.argv.length == 3) {
|
2019-05-08 15:42:13 +08:00
|
|
|
|
outputIDL = process.argv[2];
|
2019-05-08 11:26:58 +08:00
|
|
|
|
} else if(process.argv.length > 3) {
|
2019-05-08 15:42:13 +08:00
|
|
|
|
outputIDL = process.argv[2];
|
2020-04-28 09:34:09 +08:00
|
|
|
|
sourcesPath = process.argv[3];
|
2019-05-08 11:26:58 +08:00
|
|
|
|
}
|
|
|
|
|
|
2019-05-08 15:42:13 +08:00
|
|
|
|
if(sourcesPath === '-h' || sourcesPath === '--help') {
|
|
|
|
|
console.log('Usage: node index.js outputIDL sourcesPath');
|
2019-05-08 11:26:58 +08:00
|
|
|
|
process.exit(0);
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-02 10:12:42 +08:00
|
|
|
|
IDLGen.gen(sourcesPath, outputIDL)
|
|
|
|
|
|