render if EOL is different than the option
This commit is contained in:
parent
4a317009e0
commit
9762e64feb
@ -5,7 +5,7 @@ import * as fs from "fs";
|
||||
import * as path from "path";
|
||||
import { EOL } from "os";
|
||||
import IConnectionOptions from "./IConnectionOptions";
|
||||
import IGenerationOptions from "./IGenerationOptions";
|
||||
import IGenerationOptions, { eolConverter } from "./IGenerationOptions";
|
||||
import { Entity } from "./models/Entity";
|
||||
import { Relation } from "./models/Relation";
|
||||
|
||||
@ -73,10 +73,10 @@ function generateModels(
|
||||
);
|
||||
const rendered = entityCompliedTemplate(element);
|
||||
const withImportStatements = removeUnusedImports(
|
||||
EOL !== generationOptions.convertEol
|
||||
EOL !== eolConverter[generationOptions.convertEol]
|
||||
? rendered.replace(
|
||||
/(\r\n|\n|\r)/gm,
|
||||
generationOptions.convertEol
|
||||
eolConverter[generationOptions.convertEol]
|
||||
)
|
||||
: rendered
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user