MCPcopy Create free account
hub / github.com/continuedev/continue / loadHooksConfig

Function loadHooksConfig

extensions/cli/src/hooks/hookConfig.ts:101–123  ·  view source on GitHub ↗
(
  cwd: string = process.cwd(),
  homeDir?: string,
)

Source from the content-addressed store, hash-verified

99 * Load all hook configurations from settings files and merge them.
100 */
101export function loadHooksConfig(
102 cwd: string = process.cwd(),
103 homeDir?: string,
104): LoadedHooksConfig {
105 const paths = getSettingsFilePaths(cwd, homeDir);
106 let mergedHooks: HooksConfig = {};
107 let disabled = false;
108
109 for (const filePath of paths) {
110 const settings = loadSettingsFile(filePath);
111 if (!settings) continue;
112
113 if (settings.disableAllHooks) {
114 disabled = true;
115 }
116
117 if (settings.hooks) {
118 mergedHooks = mergeHooksConfigs(mergedHooks, settings.hooks);
119 }
120 }
121
122 return { hooks: mergedHooks, disabled };
123}
124
125/**
126 * Get matching hook handlers for a given event and matcher value.

Callers 3

doInitializeMethod · 0.85
reloadConfigMethod · 0.85
loadIsolatedFunction · 0.85

Calls 3

getSettingsFilePathsFunction · 0.85
loadSettingsFileFunction · 0.85
mergeHooksConfigsFunction · 0.85

Tested by 1

loadIsolatedFunction · 0.68