File tree Expand file tree Collapse file tree 6 files changed +2
-18
lines changed
Expand file tree Collapse file tree 6 files changed +2
-18
lines changed Original file line number Diff line number Diff line change 1- import { existsSync } from 'fs' ;
21import { resolve as pathResolve } from 'path' ;
2+ import { resolvePluggablePath } from '../utils/files.util' ;
33import { ConfigMockI , ConfigMockModel } from './config-mock.model' ;
44import { TemplateConfigModel } from './template-config.model' ;
55
@@ -73,23 +73,7 @@ class ConfigModel implements ConfigI {
7373 get templatePath ( ) : string {
7474 if ( ! this . template ) { return null ; }
7575 if ( ! this . _templatePath ) {
76- // Generate the template path
77- const template = this . template ;
78- if ( existsSync ( template ) ) {
79- this . _templatePath = template ;
80- } else {
81- this . _templatePath = pathResolve (
82- __dirname ,
83- '..' ,
84- '..' ,
85- 'templates' ,
86- template ,
87- ) ;
88- }
89- }
90-
91- if ( ! existsSync ( this . _templatePath ) ) {
92- throw `Template ${ this . template } not exist` ;
76+ this . _templatePath = resolvePluggablePath ( this . template , 'templates' ) ;
9377 }
9478 return this . _templatePath ;
9579 }
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
You can’t perform that action at this time.
0 commit comments