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

Function isDirectoryEmptyOrMissing

packages/node-runtime/src/data-dir-switch.ts:143–151  ·  view source on GitHub ↗
(dirPath: string)

Source from the content-addressed store, hash-verified

141}
142
143export function isDirectoryEmptyOrMissing(dirPath: string): boolean {
144 if (!fs.existsSync(dirPath)) return true
145
146 try {
147 return fs.readdirSync(dirPath).length === 0
148 } catch {
149 return false
150 }
151}
152
153export function copyDirMerge(
154 src: string,

Callers 2

createNodeDataDirSwitchFunction · 0.85
setCustomDataDirFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected