MCPcopy Index your code
hub / github.com/github/docs / getCatAndSubCat

Function getCatAndSubCat

tests/rendering/sidebar.js:110–125  ·  view source on GitHub ↗
(directory)

Source from the content-addressed store, hash-verified

108 }
109 // Recursively go through the content/rest directory and get all the absolute file names
110 function getCatAndSubCat(directory) {
111 fs.readdirSync(directory).forEach((file) => {
112 const absolute = path.join(directory, file)
113 if (fs.statSync(absolute).isDirectory()) {
114 return getCatAndSubCat(absolute)
115 } else if (
116 !directory.includes('rest/guides') &&
117 !directory.includes('rest/overview') &&
118 !absolute.includes('rest/index.md') &&
119 !absolute.includes('rest/quickstart.md') &&
120 !file.includes('README.md')
121 ) {
122 return contentFiles.push(absolute)
123 }
124 })
125 }
126
127 // Create a ContentCheck object that has all the categories/subcategories and get the title from frontmatter
128 async function createContentCheckDirectory() {

Callers 1

sidebar.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected