(cwd, appDir, articlesDir, jenkinsPosition)
| 68 | }; |
| 69 | |
| 70 | function gatherArticles(cwd, appDir, articlesDir, jenkinsPosition) { |
| 71 | // Gather all main subfolders - ui |
| 72 | var subDirs = fs.readdirSync(appDir).filter(function (file) { |
| 73 | var filePath = path.join(appDir, file); |
| 74 | var dir = fs.statSync(filePath); |
| 75 | |
| 76 | return dir.isDirectory() && path.parse(filePath).name.indexOf(CATEGORY) !== -1; |
| 77 | }); |
| 78 | |
| 79 | subDirs.forEach(function (subDir) { |
| 80 | var currentDir = path.join(articlesDir, subDir); |
| 81 | currentDir = updateSubfoldersName(currentDir); |
| 82 | fs.mkdirSync(currentDir); |
| 83 | |
| 84 | var subDirPath = path.join(appDir, subDir); |
| 85 | |
| 86 | // Gather all component overviews in the subdirs - ns-ui-widgets-category, data-category |
| 87 | var components = glob.sync(subDirPath + "/*/overview.md").filter(function (file) { |
| 88 | return !path.parse(file).dir.endsWith(CATEGORY); |
| 89 | }).sort(compareFiles); |
| 90 | getComponents(cwd, components, currentDir, jenkinsPosition); |
| 91 | gatherArticles(cwd, subDirPath, currentDir, jenkinsPosition); |
| 92 | }); |
| 93 | |
| 94 | // Gather all component overviews in the main folders - app |
| 95 | var components = glob.sync(appDir + "/**/overview.md").filter(function (file) { |
| 96 | return path.parse(file).dir.indexOf(CATEGORY) === -1; |
| 97 | }).sort(compareFiles); |
| 98 | |
| 99 | getComponents(cwd, components, articlesDir, jenkinsPosition); |
| 100 | } |
| 101 | |
| 102 | // Gather all component overviews |
| 103 | function getComponents(cwd, components, currentDir, jenkinsPosition) { |
no test coverage detected