MCPcopy Create free account
hub / github.com/RomanHotsiy/commitgpt / loadPromptTemplate

Function loadPromptTemplate

config_storage.ts:61–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59}
60
61export function loadPromptTemplate(): string {
62 if (existsSync(LOCAL_CONFIG_PATH)) {
63 const temp = readFileSync(LOCAL_PROMPT_TEMPLATE_PATH, "utf-8");
64 assertTempValid(temp);
65
66 return temp;
67 }
68
69 if (existsSync(GLOBAL_PROMPT_TEMPLATE_PATH)) {
70 const temp = readFileSync(GLOBAL_PROMPT_TEMPLATE_PATH, "utf-8");
71 assertTempValid(temp);
72
73 return temp;
74 }
75
76 return defaultPromptTemplate;
77}
78
79export function getConfig<T>(key: string): T {
80 const config = load();

Callers 1

runFunction · 0.85

Calls 1

assertTempValidFunction · 0.85

Tested by

no test coverage detected