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

Function copyInstallCommand

website/src/scripts/pages/skills.ts:59–70  ·  view source on GitHub ↗
(skillId: string, btn: HTMLButtonElement)

Source from the content-addressed store, hash-verified

57}
58
59async function copyInstallCommand(skillId: string, btn: HTMLButtonElement): Promise<void> {
60 const command = `gh skills install ${REPO_IDENTIFIER} ${skillId}`;
61 const originalContent = btn.innerHTML;
62 const success = await copyToClipboard(command);
63 showToast(success ? 'Install command copied!' : 'Failed to copy', success ? 'success' : 'error');
64 if (success) {
65 btn.innerHTML = '<svg viewBox="0 0 16 16" width="16" height="16" fill="currentColor"><path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.75.75 0 0 1 1.06-1.06L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0z"/></svg> Copied!';
66 setTimeout(() => {
67 btn.innerHTML = originalContent;
68 }, 2000);
69 }
70}
71
72async function downloadSkill(skillId: string, btn: HTMLButtonElement): Promise<void> {
73 const skill = allItems.find((item) => item.id === skillId);

Callers 1

Calls 2

copyToClipboardFunction · 0.90
showToastFunction · 0.90

Tested by

no test coverage detected