Allow models which don't generate properly to be saved
This commit is contained in:
parent
fa85567d5a
commit
4a7b1338f0
@ -80,18 +80,22 @@ function generateModels(
|
||||
)
|
||||
: rendered
|
||||
);
|
||||
let formatted = "";
|
||||
try {
|
||||
const formatted = Prettier.format(withImportStatements, {
|
||||
parser: 'typescript',
|
||||
});
|
||||
fs.writeFileSync(resultFilePath, formatted, {
|
||||
encoding: 'UTF-8',
|
||||
flag: 'w',
|
||||
formatted = Prettier.format(withImportStatements, {
|
||||
parser: "typescript"
|
||||
});
|
||||
} catch (error) {
|
||||
console.log('Trouble when generate for table: ', element.sqlName);
|
||||
console.log(
|
||||
"There were some problems with model generation for table: ",
|
||||
element.sqlName
|
||||
);
|
||||
console.log(error);
|
||||
}
|
||||
fs.writeFileSync(resultFilePath, formatted, {
|
||||
encoding: "UTF-8",
|
||||
flag: "w"
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user