MCPcopy Index your code
hub / github.com/Waishnav/devspace / runConfigCommand

Function runConfigCommand

src/cli.ts:231–257  ·  view source on GitHub ↗
(args: string[])

Source from the content-addressed store, hash-verified

229}
230
231function 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
259function printHelp(): void {
260 console.log(

Callers 1

mainFunction · 0.85

Calls 3

loadDevspaceFilesFunction · 0.85
writeDevspaceConfigFunction · 0.85

Tested by

no test coverage detected