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) {
const content = fs.readFileSync(filename).toString();
const name = filename.match(/[a-z|_\d|\.|A-Z]*\/[a-z|_\d|\.|A-Z]*$/)[0];
try {
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);
this.filename = name;
this.fullFileName = filename;
this.parseFileContent(name, content);
console.log('Process: ' + filename);
this.filename = name;
this.fullFileName = filename;
this.parseFileContent(name, content);
}catch(e) {
console.log(e);
}
}
parseFolder(folder) {