(args: string[])
| 229 | } |
| 230 | |
| 231 | function runConfigCommand(args: string[]): void { |
| 232 | const [subcommand, key, ...rest] = args; |
| 233 | const files = loadDevspaceFiles(); |
| 234 | |
| 235 | if (!subcommand || subcommand === "get") { |
| 236 | console.log(JSON.stringify(files.config, null, 2)); |
| 237 | return; |
| 238 | } |
| 239 | |
| 240 | if (subcommand !== "set") { |
| 241 | throw new Error(`Unknown config command: ${subcommand}`); |
| 242 | } |
| 243 | if (key !== "publicBaseUrl") { |
| 244 | throw new Error("Only `devspace config set publicBaseUrl <url|null>` is supported right now."); |
| 245 | } |
| 246 | |
| 247 | const value = rest.join(" ").trim(); |
| 248 | if (!value) { |
| 249 | throw new Error("Missing publicBaseUrl value."); |
| 250 | } |
| 251 | |
| 252 | writeDevspaceConfig({ |
| 253 | ...files.config, |
| 254 | publicBaseUrl: normalizeOptionalPublicBaseUrl(value), |
| 255 | }); |
| 256 | console.log(`Updated ${files.configPath}`); |
| 257 | } |
| 258 | |
| 259 | function printHelp(): void { |
| 260 | console.log( |
no test coverage detected