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

Function loadSettingsFile

extensions/cli/src/hooks/hookConfig.ts:33–45  ·  view source on GitHub ↗

* Load and parse a settings JSON file, returning only the hooks portion. * Returns null if file doesn't exist or fails to parse.

(filePath: string)

Source from the content-addressed store, hash-verified

31 * Returns null if file doesn't exist or fails to parse.
32 */
33function loadSettingsFile(filePath: string): HookSettingsFile | null {
34 try {
35 if (!fs.existsSync(filePath)) {
36 return null;
37 }
38 const content = fs.readFileSync(filePath, "utf-8");
39 const parsed = JSON.parse(content);
40 return parsed as HookSettingsFile;
41 } catch (error) {
42 logger.warn(`Failed to load hooks settings from ${filePath}:`, error);
43 return null;
44 }
45}
46
47/**
48 * Merge two hook configs. Later config entries are appended (not replaced).

Callers 1

loadHooksConfigFunction · 0.85

Calls 1

warnMethod · 0.80

Tested by

no test coverage detected