MCPcopy Create free account
hub / github.com/github/awesome-copilot / getAllFiles

Function getAllFiles

eng/yaml-parser.mjs:146–164  ·  view source on GitHub ↗
(dirPath, arrayOfFiles = [])

Source from the content-addressed store, hash-verified

144
145 // List bundled assets (all files except SKILL.md), recursing through subdirectories
146 const getAllFiles = (dirPath, arrayOfFiles = []) => {
147 const files = fs.readdirSync(dirPath);
148 const assetPaths = ['references', 'assets', 'scripts'];
149
150 files.forEach((file) => {
151 const filePath = path.join(dirPath, file);
152 if (fs.statSync(filePath).isDirectory() && assetPaths.includes(file)) {
153 arrayOfFiles = getAllFiles(filePath, arrayOfFiles);
154 } else {
155 const relativePath = path.relative(skillPath, filePath);
156 if (relativePath !== "SKILL.md") {
157 // Normalize path separators to forward slashes for cross-platform consistency
158 arrayOfFiles.push(relativePath.replace(/\\/g, "/"));
159 }
160 }
161 });
162
163 return arrayOfFiles;
164 };
165
166 const assets = getAllFiles(skillPath).sort();
167

Callers 2

parseSkillMetadataFunction · 0.85
parseHookMetadataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected