mirror of
https://github.com/github/awesome-copilot.git
synced 2026-02-23 20:05:12 +00:00
Fix path matching in getResourceType to support relative paths
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
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