()
| 59 | } |
| 60 | |
| 61 | export 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 | |
| 79 | export function getConfig<T>(key: string): T { |
| 80 | const config = load(); |
no test coverage detected