MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getImagePathFromClipboard

Function getImagePathFromClipboard

src/utils/imagePaste.ts:244–261  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

242}
243
244export async function getImagePathFromClipboard(): Promise<string | null> {
245 const { commands } = getClipboardCommands()
246
247 try {
248 // Try to get text from clipboard
249 const result = await execa(commands.getPath, {
250 shell: true,
251 reject: false,
252 })
253 if (result.exitCode !== 0 || !result.stdout) {
254 return null
255 }
256 return result.stdout.trim()
257 } catch (e) {
258 logError(e as Error)
259 return null
260 }
261}
262
263/**
264 * Regex pattern to match supported image file extensions. Kept in sync with

Callers 1

tryReadImageFromPathFunction · 0.85

Calls 2

getClipboardCommandsFunction · 0.85
logErrorFunction · 0.70

Tested by

no test coverage detected