@@ -62,27 +62,31 @@ class TemplatesGenProcess {
62
62
const templateEjsPathExist = this . fileSystem . pathIsExist ( templateEjsPath ) ;
63
63
const templateEtaPathExist = this . fileSystem . pathIsExist ( templateEtaPath ) ;
64
64
65
- if ( this . config . rewrite || ( ! templateEjsPathExist && ! templateEtaPathExist ) ) {
65
+ const templateNotExist = ! templateEjsPathExist && ! templateEtaPathExist ;
66
+
67
+ if ( templateNotExist ) {
66
68
this . fileSystem . createFile ( {
67
69
path : outputPath ,
68
70
fileName : template . name ,
69
71
content : template . content ,
70
72
withPrefix : false ,
71
73
} ) ;
72
- } else if ( templateEjsPathExist ) {
73
- this . fileSystem . createFile ( {
74
- path : outputPath ,
75
- fileName : `${ templateName } .ejs` ,
76
- content : template . content ,
77
- withPrefix : false ,
78
- } ) ;
79
- } else if ( templateEtaPathExist ) {
80
- this . fileSystem . createFile ( {
81
- path : outputPath ,
82
- fileName : `${ templateName } .eta` ,
83
- content : template . content ,
84
- withPrefix : false ,
85
- } ) ;
74
+ } else if ( this . config . rewrite ) {
75
+ if ( templateEjsPathExist ) {
76
+ this . fileSystem . createFile ( {
77
+ path : outputPath ,
78
+ fileName : `${ templateName } .ejs` ,
79
+ content : template . content ,
80
+ withPrefix : false ,
81
+ } ) ;
82
+ } else if ( templateEtaPathExist ) {
83
+ this . fileSystem . createFile ( {
84
+ path : outputPath ,
85
+ fileName : `${ templateName } .eta` ,
86
+ content : template . content ,
87
+ withPrefix : false ,
88
+ } ) ;
89
+ }
86
90
}
87
91
} ) ;
88
92
0 commit comments