MCPcopy Create free account
hub / github.com/codeHappyDananx/SpecWave / createUniqueImageName

Function createUniqueImageName

electron/main.js:1071–1082  ·  view source on GitHub ↗
(dirPath, prefix)

Source from the content-addressed store, hash-verified

1069}
1070
1071function createUniqueImageName(dirPath, prefix) {
1072 const stamp = formatTimestamp(new Date())
1073 let fileName = `${prefix}${stamp}${PASTE_IMAGE_EXT}`
1074 let filePath = path.join(dirPath, fileName)
1075 let counter = 1
1076 while (fs.existsSync(filePath)) {
1077 fileName = `${prefix}${stamp}-${counter}${PASTE_IMAGE_EXT}`
1078 filePath = path.join(dirPath, fileName)
1079 counter += 1
1080 }
1081 return { fileName, filePath }
1082}
1083
1084function isGitRepoRoot(cwd) {
1085 const gitDir = path.join(cwd, '.git')

Callers 1

saveClipboardImageFunction · 0.85

Calls 1

formatTimestampFunction · 0.85

Tested by

no test coverage detected