File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
templates/package-builder/src/yeoman/app Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,7 @@ class MyGenerator extends yeoman.Base {
137137 if ( emitFile ) {
138138 let inputFullPath = path . join ( templateRoot , fn ) ;
139139 let destinationFullPath = this . destinationPath ( outputFn ) ;
140+ let deleteInputFileAfter = false ;
140141 if ( path . basename ( fn ) === 'package.json' ) {
141142 // Special handling for package.json, because we rewrite it dynamically
142143 const tempPath = destinationFullPath + '.tmp' ;
@@ -147,6 +148,7 @@ class MyGenerator extends yeoman.Base {
147148 /* space */ 2
148149 ) ;
149150 inputFullPath = tempPath ;
151+ deleteInputFileAfter = true ;
150152 }
151153
152154 const outputDirBasename = path . basename ( path . dirname ( destinationFullPath ) ) ;
@@ -164,6 +166,10 @@ class MyGenerator extends yeoman.Base {
164166 this . _answers
165167 ) ;
166168 }
169+
170+ if ( deleteInputFileAfter ) {
171+ this . fs . delete ( inputFullPath ) ;
172+ }
167173 }
168174 } ) ;
169175 }
You can’t perform that action at this time.
0 commit comments