forked from loafle/openapi-generator-original
stop reading custom template file from subdirectories
This commit is contained in:
parent
34fed26e79
commit
83e8a2e90c
@ -72,28 +72,20 @@ public abstract class AbstractGenerator {
|
||||
* @return String Full template file path
|
||||
*/
|
||||
public String getFullTemplateFile(CodegenConfig config, String templateFile) {
|
||||
String library = config.getLibrary();
|
||||
if (library != null && !"".equals(library)) {
|
||||
String libTemplateFile = config.templateDir() + File.separator +
|
||||
"libraries" + File.separator + library + File.separator +
|
||||
templateFile;
|
||||
|
||||
if (new File(libTemplateFile).exists()) {
|
||||
return libTemplateFile;
|
||||
}
|
||||
|
||||
libTemplateFile = config.embeddedTemplateDir() + File.separator +
|
||||
"libraries" + File.separator + library + File.separator +
|
||||
templateFile;
|
||||
if (embeddedTemplateExists(libTemplateFile)) {
|
||||
// Fall back to the template file embedded/packaged in the JAR file...
|
||||
return libTemplateFile;
|
||||
}
|
||||
}
|
||||
String template = config.templateDir() + File.separator + templateFile;
|
||||
if (new File(template).exists()) {
|
||||
return template;
|
||||
} else {
|
||||
String library = config.getLibrary();
|
||||
if (library != null && !"".equals(library)) {
|
||||
String libTemplateFile = config.embeddedTemplateDir() + File.separator +
|
||||
"libraries" + File.separator + library + File.separator +
|
||||
templateFile;
|
||||
if (embeddedTemplateExists(libTemplateFile)) {
|
||||
// Fall back to the template file embedded/packaged in the JAR file...
|
||||
return libTemplateFile;
|
||||
}
|
||||
}
|
||||
// Fall back to the template file embedded/packaged in the JAR file...
|
||||
return config.embeddedTemplateDir() + File.separator + templateFile;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user