mirror of
https://github.com/github/awesome-copilot.git
synced 2026-02-20 18:35:14 +00:00
Fix plugin detection in getResourceType for deep-linking
Update getResourceType to detect plugin directories (plugins/<id>) and plugin.json files instead of .collection.yml files. This fixes deep-linking via #file=plugins/<id> which was previously resolving to 'unknown' and not opening the plugin modal. Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
This commit is contained in:
@@ -233,7 +233,9 @@ export function getResourceType(filePath: string): string {
|
||||
return "skill";
|
||||
if (/(^|\/)hooks\//.test(filePath) && filePath.endsWith("README.md"))
|
||||
return "hook";
|
||||
if (filePath.endsWith(".collection.yml")) return "plugin";
|
||||
// Check for plugin directories (e.g., plugins/<id>) or plugin.json files
|
||||
if (/(^|\/)plugins\/[^/]+\/?$/.test(filePath) || filePath.endsWith("/.github/plugin/plugin.json"))
|
||||
return "plugin";
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user