mirror of
https://github.com/github/awesome-copilot.git
synced 2026-02-20 02:15:12 +00:00
Merge pull request #691 from github/copilot/sub-pr-685
Fix path matching in getResourceType to handle relative paths
This commit is contained in:
@@ -229,9 +229,9 @@ export function getResourceType(filePath: string): string {
|
|||||||
if (filePath.endsWith(".agent.md")) return "agent";
|
if (filePath.endsWith(".agent.md")) return "agent";
|
||||||
if (filePath.endsWith(".prompt.md")) return "prompt";
|
if (filePath.endsWith(".prompt.md")) return "prompt";
|
||||||
if (filePath.endsWith(".instructions.md")) return "instruction";
|
if (filePath.endsWith(".instructions.md")) return "instruction";
|
||||||
if (filePath.includes("/skills/") && filePath.endsWith("SKILL.md"))
|
if (/(^|\/)skills\//.test(filePath) && filePath.endsWith("SKILL.md"))
|
||||||
return "skill";
|
return "skill";
|
||||||
if (filePath.includes("/hooks/") && filePath.endsWith("README.md"))
|
if (/(^|\/)hooks\//.test(filePath) && filePath.endsWith("README.md"))
|
||||||
return "hook";
|
return "hook";
|
||||||
if (filePath.endsWith(".collection.yml")) return "collection";
|
if (filePath.endsWith(".collection.yml")) return "collection";
|
||||||
return "unknown";
|
return "unknown";
|
||||||
|
|||||||
Reference in New Issue
Block a user