MCPcopy Index your code
hub / github.com/github/awesome-copilot / getResourceType

Function getResourceType

website/src/scripts/utils.ts:428–440  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

426 * Get resource type from file path
427 */
428export function getResourceType(filePath: string): string {
429 if (filePath.endsWith(".agent.md")) return "agent";
430 if (filePath.endsWith(".instructions.md")) return "instruction";
431 if (/(^|\/)skills\//.test(filePath)) return "skill";
432 if (/(^|\/)hooks\//.test(filePath)) return "hook";
433 if (/(^|\/)workflows\//.test(filePath) && filePath.endsWith(".md"))
434 return "workflow";
435 // Check for plugin directories (e.g., plugins/<id>, plugins/<id>/)
436 if (/(^|\/)plugins\/[^/]+\/?$/.test(filePath)) return "plugin";
437 // Check for plugin.json files (e.g., plugins/<id>/.github/plugin/plugin.json)
438 if (filePath.endsWith("/.github/plugin/plugin.json")) return "plugin";
439 return "unknown";
440}
441
442/**
443 * Format a resource type for display

Callers 3

getSkillItemByFilePathFunction · 0.90
setupModalFunction · 0.90
handleHashChangeFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected