File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ export default class ThesisLighthouse {
42
42
43
43
const newAccessibilityJSON = this . #produceNewJSON( data , accessibilityScores )
44
44
45
- this . #checkDir( )
45
+ this . #checkDir( [ ` ${ this . #outputDir } ` , ` ${ this . #outputDir } logs` ] )
46
46
const rawOutputFilename = this . #createFileName( data ?. requestedUrl )
47
47
48
48
writeFileSync ( rawOutputFilename , JSON . stringify ( data ) , { flag : 'w' } )
@@ -81,17 +81,22 @@ export default class ThesisLighthouse {
81
81
return ( ! existsSync ( location ) ) ? readFileSync ( backup ) : readFileSync ( location )
82
82
}
83
83
84
- #checkDir = ( ) => {
85
- this . #makeDirIfNotExists( `${ this . #outputDir} ` )
86
- this . #makeDirIfNotExists( `${ this . #outputDir} logs` )
84
+ #checkDir = ( directories ) => {
85
+ switch ( typeof directories ) {
86
+ case "object" :
87
+ directories . forEach ( directory => this . #makeDirIfNotExists( directory ) )
88
+ break ;
89
+ case "string" :
90
+ this . #makeDirIfNotExists( directories )
91
+ break ;
92
+ }
87
93
}
88
94
89
95
#makeDirIfNotExists = ( location ) => {
90
96
if ( ! existsSync ( location ) ) mkdirSync ( location )
91
97
}
92
98
93
99
start = ( ) => {
94
-
95
100
const isOptionsCategories = getCategoriesFlags ( this . options ?. categories )
96
101
const currentFlags = `${ isOptionsCategories } \n\t--output json \n\t--disable-full-page-screenshot \n\t--chrome-flags="\n\t\t--no-sandbox \n\t\t--headless \n\t\t--disable-gpu"`
97
102
You can’t perform that action at this time.
0 commit comments