@@ -3,7 +3,7 @@ import {jsonc} from 'jsonc';
33import { join } from 'path' ;
44import { findAngularJsonPath } from './findAngularJsonPath' ;
55import { ScullyConfig } from './interfacesandenums' ;
6- import { logError } from './log' ;
6+ import { logError , logWarn , yellow } from './log' ;
77import { validateConfig } from './validateConfig' ;
88import { compileConfig } from './compileConfig' ;
99
@@ -45,17 +45,24 @@ const loadIt = async () => {
4545 distFolder,
4646 appPort : /** 1864 */ 'herodevs' . split ( '' ) . reduce ( ( sum , token ) => ( sum += token . charCodeAt ( 0 ) ) , 1000 ) ,
4747 staticport : /** 1771 */ 'scully' . split ( '' ) . reduce ( ( sum , token ) => ( sum += token . charCodeAt ( 0 ) ) , 1000 ) ,
48- } ,
49- await updateScullyConfig ( compiledConfig )
48+ }
5049 // compiledConfig
5150 ) as ScullyConfig ;
51+ await updateScullyConfig ( compiledConfig ) ;
5252 return scullyConfig ;
5353} ;
5454export const loadConfig = loadIt ( ) ;
5555
5656export const updateScullyConfig = async ( config : Partial < ScullyConfig > ) => {
5757 /** note, an invalid config will abort the entire program. */
5858 const newConfig = Object . assign ( { } , scullyConfig , config ) ;
59+ if ( config . outFolder === undefined ) {
60+ logWarn (
61+ `The option outFolder isn't configures, we are using "${ yellow ( scullyConfig . outFolder ) } by default now"`
62+ ) ;
63+ } else {
64+ config . outFolder = join ( angularRoot , config . outFolder ) ;
65+ }
5966 const validatedConfig = await validateConfig ( newConfig as ScullyConfig ) ;
6067 if ( validatedConfig ) {
6168 const mergedRoutes = { ...scullyConfig . routes , ...validatedConfig . routes } ;
0 commit comments