File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
packages/angular_devkit/schematics/src/rules Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ import { TextDecoder } from 'util';
11
11
import { FileOperator , Rule } from '../engine/interface' ;
12
12
import { FileEntry } from '../tree/interface' ;
13
13
import { chain , composeFileOperators , forEach , when } from './base' ;
14
- import { rename } from './rename' ;
15
14
16
15
export const TEMPLATE_FILENAME_RE = / \. t e m p l a t e $ / ;
17
16
@@ -157,10 +156,16 @@ export function pathTemplate<T extends PathTemplateData>(options: T): Rule {
157
156
* Remove every `.template` suffix from file names.
158
157
*/
159
158
export function renameTemplateFiles ( ) : Rule {
160
- return rename (
161
- ( path ) => ! ! path . match ( TEMPLATE_FILENAME_RE ) ,
162
- ( path ) => path . replace ( TEMPLATE_FILENAME_RE , '' ) ,
163
- ) ;
159
+ return forEach ( ( entry ) => {
160
+ if ( entry . path . match ( TEMPLATE_FILENAME_RE ) ) {
161
+ return {
162
+ content : entry . content ,
163
+ path : normalize ( entry . path . replace ( TEMPLATE_FILENAME_RE , '' ) ) ,
164
+ } ;
165
+ } else {
166
+ return entry ;
167
+ }
168
+ } ) ;
164
169
}
165
170
166
171
export function template < T extends object > ( options : T ) : Rule {
You can’t perform that action at this time.
0 commit comments