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

Function unlinkIfOld

src/utils/cleanup.ts:134–145  ·  view source on GitHub ↗
(
  filePath: string,
  cutoffDate: Date,
  fsImpl: FsOperations,
)

Source from the content-addressed store, hash-verified

132}
133
134async function unlinkIfOld(
135 filePath: string,
136 cutoffDate: Date,
137 fsImpl: FsOperations,
138): Promise<boolean> {
139 const stats = await fsImpl.stat(filePath)
140 if (stats.mtime < cutoffDate) {
141 await fsImpl.unlink(filePath)
142 return true
143 }
144 return false
145}
146
147async function tryRmdir(dirPath: string, fsImpl: FsOperations): Promise<void> {
148 try {

Callers 3

cleanupOldSessionFilesFunction · 0.85
cleanupSingleDirectoryFunction · 0.85
cleanupOldDebugLogsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected