mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-04 14:40:53 +00:00
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
|
* @return String Full template file path
|
||||||
*/
|
*/
|
||||||
public String getFullTemplateFile(CodegenConfig config, String templateFile) {
|
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;
|
String template = config.templateDir() + File.separator + templateFile;
|
||||||
if (new File(template).exists()) {
|
if (new File(template).exists()) {
|
||||||
return template;
|
return template;
|
||||||
} else {
|
} 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...
|
// Fall back to the template file embedded/packaged in the JAR file...
|
||||||
return config.embeddedTemplateDir() + File.separator + templateFile;
|
return config.embeddedTemplateDir() + File.separator + templateFile;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user