(key: string, options: { showSecrets?: boolean } = {})
| 200 | } |
| 201 | |
| 202 | export const runConfigEnvGet = async (key: string, options: { showSecrets?: boolean } = {}): Promise<number> => { |
| 203 | const normalizedKey = key.trim() |
| 204 | |
| 205 | if (!isSupportedEnvKey(normalizedKey)) { |
| 206 | logError(`Unsupported env key: ${normalizedKey}`) |
| 207 | return 1 |
| 208 | } |
| 209 | |
| 210 | const values = readEnvValues() |
| 211 | const value = values[normalizedKey] |
| 212 | |
| 213 | if (value === undefined) { |
| 214 | logError(`Env key not set: ${normalizedKey}`) |
| 215 | return 1 |
| 216 | } |
| 217 | |
| 218 | const displayValue = options.showSecrets || !isSecretEnvKey(normalizedKey) ? value : maskSecretValue(value) |
| 219 | logInfo(displayValue) |
| 220 | return 0 |
| 221 | } |
| 222 | |
| 223 | export const runConfigEnvSet = async (key: string, value: string): Promise<number> => { |
| 224 | const normalizedKey = key.trim() |
no test coverage detected