improve idl gen

This commit is contained in:
lixianjing 2021-06-04 11:44:17 +08:00
parent b5db15da65
commit 3a51a17749

View File

@ -344,13 +344,17 @@ class IDLGen {
} }
parseFile(filename) { parseFile(filename) {
const content = fs.readFileSync(filename).toString(); try {
const name = filename.match(/[a-z|_\d|\.|A-Z]*\/[a-z|_\d|\.|A-Z]*$/)[0]; const content = fs.readFileSync(filename).toString();
const name = filename.match(/[a-z|_\d|\.|A-Z]*\/[a-z|_\d|\.|A-Z]*$/)[0];
console.log('Process: ' + filename); console.log('Process: ' + filename);
this.filename = name; this.filename = name;
this.fullFileName = filename; this.fullFileName = filename;
this.parseFileContent(name, content); this.parseFileContent(name, content);
}catch(e) {
console.log(e);
}
} }
parseFolder(folder) { parseFolder(folder) {