MCPcopy Index your code
hub / github.com/NativeScript/nativescript-sdk-examples-js / gatherArticles

Function gatherArticles

scripts/build.js:70–100  ·  view source on GitHub ↗
(cwd, appDir, articlesDir, jenkinsPosition)

Source from the content-addressed store, hash-verified

68};
69
70function 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
103function getComponents(cwd, components, currentDir, jenkinsPosition) {

Callers 1

buildFunction · 0.85

Calls 2

updateSubfoldersNameFunction · 0.85
getComponentsFunction · 0.85

Tested by

no test coverage detected