MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / removeLegacyDir

Function removeLegacyDir

apps/desktop/main/paths.ts:556–571  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

554 * 删除旧版数据目录(可选,供用户确认后调用)
555 */
556export function removeLegacyDir(): boolean {
557 const legacyDir = getLegacyDataDir()
558
559 if (!fs.existsSync(legacyDir)) {
560 return true
561 }
562
563 try {
564 fs.rmSync(legacyDir, { recursive: true, force: true })
565 console.log(`[Paths] Removed legacy directory: ${legacyDir}`)
566 return true
567 } catch (error) {
568 console.error('[Paths] Failed to remove legacy directory:', error)
569 return false
570 }
571}
572
573// ==================== Electron 旧目录结构 → 新目录结构迁移 ====================
574

Callers

nothing calls this directly

Calls 2

getLegacyDataDirFunction · 0.85
errorMethod · 0.65

Tested by

no test coverage detected