| 97 | } |
| 98 | |
| 99 | export const runConfigGet = async (path: string, options: { json?: boolean } = {}): Promise<number> => { |
| 100 | const settings = loadMergedSettings() as unknown as Record<string, unknown> |
| 101 | const value = getByPath(settings, path) |
| 102 | |
| 103 | if (value === undefined) { |
| 104 | if (options.json) { |
| 105 | process.stderr.write(`${JSON.stringify({ error: { message: `Path not found: ${path}`, code: 1 } })}\n`) |
| 106 | return 1 |
| 107 | } |
| 108 | |
| 109 | logError(`Path not found: ${path}`) |
| 110 | return 1 |
| 111 | } |
| 112 | |
| 113 | if (options.json) { |
| 114 | logInfo(toJson(value)) |
| 115 | return 0 |
| 116 | } |
| 117 | |
| 118 | logInfo(serialize(value)) |
| 119 | return 0 |
| 120 | } |
| 121 | |
| 122 | export const runConfigSet = async ( |
| 123 | path: string, |