(key: string, value: string)
| 221 | } |
| 222 | |
| 223 | export const runConfigEnvSet = async (key: string, value: string): Promise<number> => { |
| 224 | const normalizedKey = key.trim() |
| 225 | |
| 226 | if (!isSupportedEnvKey(normalizedKey)) { |
| 227 | logError(`Unsupported env key: ${normalizedKey}`) |
| 228 | return 1 |
| 229 | } |
| 230 | |
| 231 | const issue = validateEnvPair(normalizedKey, value) |
| 232 | if (issue) { |
| 233 | logError(issue) |
| 234 | return 1 |
| 235 | } |
| 236 | |
| 237 | upsertEnvValue(normalizedKey, value) |
| 238 | logInfo(`Updated ${normalizedKey}`) |
| 239 | return 0 |
| 240 | } |
| 241 | |
| 242 | export const runConfigEnvValidate = async (): Promise<number> => { |
| 243 | const values = readEnvValues() |
no test coverage detected