@@ -3,7 +3,7 @@ import {jsonc} from 'jsonc';
3
3
import { join } from 'path' ;
4
4
import { findAngularJsonPath } from './findAngularJsonPath' ;
5
5
import { ScullyConfig } from './interfacesandenums' ;
6
- import { logError } from './log' ;
6
+ import { logError , logWarn , yellow } from './log' ;
7
7
import { validateConfig } from './validateConfig' ;
8
8
import { compileConfig } from './compileConfig' ;
9
9
@@ -45,17 +45,24 @@ const loadIt = async () => {
45
45
distFolder,
46
46
appPort : /** 1864 */ 'herodevs' . split ( '' ) . reduce ( ( sum , token ) => ( sum += token . charCodeAt ( 0 ) ) , 1000 ) ,
47
47
staticport : /** 1771 */ 'scully' . split ( '' ) . reduce ( ( sum , token ) => ( sum += token . charCodeAt ( 0 ) ) , 1000 ) ,
48
- } ,
49
- await updateScullyConfig ( compiledConfig )
48
+ }
50
49
// compiledConfig
51
50
) as ScullyConfig ;
51
+ await updateScullyConfig ( compiledConfig ) ;
52
52
return scullyConfig ;
53
53
} ;
54
54
export const loadConfig = loadIt ( ) ;
55
55
56
56
export const updateScullyConfig = async ( config : Partial < ScullyConfig > ) => {
57
57
/** note, an invalid config will abort the entire program. */
58
58
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
+ }
59
66
const validatedConfig = await validateConfig ( newConfig as ScullyConfig ) ;
60
67
if ( validatedConfig ) {
61
68
const mergedRoutes = { ...scullyConfig . routes , ...validatedConfig . routes } ;
0 commit comments