(ideType?: IdeType)
| 117 | } |
| 118 | |
| 119 | export function getConfigYamlPath(ideType?: IdeType): string { |
| 120 | const p = path.join(getContinueGlobalPath(), "config.yaml"); |
| 121 | const exists = fs.existsSync(p); |
| 122 | const isEmpty = exists && fs.readFileSync(p, "utf8").trim() === ""; |
| 123 | const needsCreation = !exists && !fs.existsSync(getConfigJsonPath()); |
| 124 | |
| 125 | if (needsCreation || isEmpty) { |
| 126 | fs.writeFileSync(p, YAML.stringify(defaultConfig)); |
| 127 | setConfigFilePermissions(p); |
| 128 | } |
| 129 | return p; |
| 130 | } |
| 131 | |
| 132 | export function getPrimaryConfigFilePath(): string { |
| 133 | const configYamlPath = getConfigYamlPath(); |
no test coverage detected