@@ -2,7 +2,7 @@ import { command } from 'yargs'
22import { logInfoWithBackground , logError } from '../utilities/log'
33import { flatMap , map , first , filter , tap } from 'rxjs/operators'
44import { rxFavicons } from '../utilities/rx-favicon'
5- import { writeFile_ , mkDirDeep_ } from '../utilities/rx-fs'
5+ import { writeFile_ , mkDirDeep_ , writeJsonFile_ } from '../utilities/rx-fs'
66import { resolve } from 'path'
77import { forkJoin } from 'rxjs'
88import readConfig_ , {
@@ -52,8 +52,32 @@ interface configModel {
5252}
5353
5454function mapResponsesToWriteableObservables ( response : configModel ) {
55- return response . result . images . map ( file =>
56- writeFile_ ( resolve ( `${ response . config . output } /${ file . name } ` ) , file . contents )
55+ return readConfig_ ( ) . pipe (
56+ flatMap ( config => {
57+ const _confg = {
58+ ...config ,
59+ generatedMetaTags : response . result . html
60+ }
61+ return writeJsonFile_ ( resolve ( 'fusing-angular.json' ) , _confg , true )
62+ } ) ,
63+ flatMap ( ( ) => {
64+ return forkJoin (
65+ ...response . result . files . map ( file =>
66+ writeFile_ (
67+ resolve ( `${ response . config . output } /${ file . name } ` ) ,
68+ file . contents
69+ )
70+ )
71+ )
72+ } ) ,
73+ map ( ( ) => {
74+ return response . result . images . map ( file =>
75+ writeFile_ (
76+ resolve ( `${ response . config . output } /${ file . name } ` ) ,
77+ file . contents
78+ )
79+ )
80+ } )
5781 )
5882}
5983
0 commit comments