MCPcopy
hub / github.com/codeaashu/claude-code / initializeFileChangedWatcher

Function initializeFileChangedWatcher

src/utils/hooks/fileChangedWatcher.ts:28–46  ·  view source on GitHub ↗
(cwd: string)

Source from the content-addressed store, hash-verified

26}
27
28export function initializeFileChangedWatcher(cwd: string): void {
29 if (initialized) return
30 initialized = true
31 currentCwd = cwd
32
33 const config = getHooksConfigFromSnapshot()
34 hasEnvHooks =
35 (config?.CwdChanged?.length ?? 0) > 0 ||
36 (config?.FileChanged?.length ?? 0) > 0
37
38 if (hasEnvHooks) {
39 registerCleanup(async () => dispose())
40 }
41
42 const paths = resolveWatchPaths(config)
43 if (paths.length === 0) return
44
45 startWatching(paths)
46}
47
48function resolveWatchPaths(
49 config?: ReturnType<typeof getHooksConfigFromSnapshot>,

Callers 1

setupFunction · 0.85

Calls 5

registerCleanupFunction · 0.85
resolveWatchPathsFunction · 0.85
startWatchingFunction · 0.85
disposeFunction · 0.70

Tested by

no test coverage detected