MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / copyToClipboard

Function copyToClipboard

packages/cli/src/utils/clipboard.ts:44–57  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

42let cachedProvider: ClipboardProvider | undefined | null = null;
43
44export function copyToClipboard(text: string): boolean {
45 if (cachedProvider === null) cachedProvider = detectProvider();
46 const provider = cachedProvider;
47 if (!provider) return false;
48 try {
49 const res = spawnSync(provider.cmd, provider.args, {
50 input: text,
51 encoding: "utf-8",
52 });
53 return res.status === 0;
54 } catch {
55 return false;
56 }
57}

Callers 1

runAddFunction · 0.85

Calls 1

detectProviderFunction · 0.85

Tested by

no test coverage detected