File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ const fs = require('fs');
7
7
8
8
const COMPONENTS_DOCS_DIR = './docs/components' ;
9
9
const SERVICES_DOCS_DIR = './docs/services' ;
10
+ const FOUNDATION_DOCS_DIR = './docs/foundation' ;
10
11
11
12
const VALID_COMPONENTS_CATEGORIES = [
12
13
'foundation' ,
@@ -92,14 +93,22 @@ function processComponents(components) {
92
93
content += `${ buildOldDocs ( component ) } \n` ;
93
94
}
94
95
95
-
96
96
let dirPath ;
97
- if ( component . category === 'services' ) {
98
- dirPath = `${ SERVICES_DOCS_DIR } ` ;
99
- } else {
100
- const componentParentDir =
101
- componentParentName || isParentComponent ? `/${ componentParentName || componentName } ` : '' ;
102
- dirPath = `${ COMPONENTS_DOCS_DIR } /${ component . category } ${ componentParentDir } ` ;
97
+ switch ( component . category ) {
98
+ case 'services' : {
99
+ dirPath = `${ SERVICES_DOCS_DIR } ` ;
100
+ break ;
101
+ }
102
+ case 'foundation' : {
103
+ dirPath = `${ FOUNDATION_DOCS_DIR } ` ;
104
+ break ;
105
+ }
106
+ default : {
107
+ const componentParentDir =
108
+ componentParentName || isParentComponent ? `/${ componentParentName || componentName } ` : '' ;
109
+ dirPath = `${ COMPONENTS_DOCS_DIR } /${ component . category } ${ componentParentDir } ` ;
110
+ break ;
111
+ }
103
112
}
104
113
105
114
if ( ! fs . existsSync ( dirPath ) ) {
You can’t perform that action at this time.
0 commit comments