diff --git a/src/cli/dashboard/_shared/base.ts b/src/cli/dashboard/_shared/base.ts index 76b7bd5d..23ce0000 100644 --- a/src/cli/dashboard/_shared/base.ts +++ b/src/cli/dashboard/_shared/base.ts @@ -52,22 +52,22 @@ export abstract class DashboardCommand extends Command { }; private _client: DashboardClient | undefined; - private _config: CliConfig | undefined; + private _cliConfig: CliConfig | undefined; - protected get config_(): CliConfig { - if (!this._config) { + protected get cliConfig(): CliConfig { + if (!this._cliConfig) { const config = loadConfig(); if (!config) { this.error('Not logged in. Run `cascade login` first.'); } - this._config = config; + this._cliConfig = config; } - return this._config; + return this._cliConfig; } protected get client(): DashboardClient { if (!this._client) { - const config = this.config_; + const config = this.cliConfig; // Allow --server and --org flags to override const flags = this.parseBaseFlags(); if (flags?.server) { @@ -192,7 +192,7 @@ export abstract class DashboardCommand extends Command { process.stderr.write(`${err.stack}\n`); } - const serverUrl = this._config?.serverUrl; + const serverUrl = this._cliConfig?.serverUrl; const actionable = mapError(err, serverUrl); const message = formatActionableError(actionable); diff --git a/src/cli/dashboard/webhooks/create.ts b/src/cli/dashboard/webhooks/create.ts index 8e0a0d21..fca76db1 100644 --- a/src/cli/dashboard/webhooks/create.ts +++ b/src/cli/dashboard/webhooks/create.ts @@ -29,7 +29,7 @@ export default class WebhooksCreate extends DashboardCommand { const { args, flags } = await this.parse(WebhooksCreate); try { - const callbackBaseUrl = flags['callback-url'] || this.config_.serverUrl; + const callbackBaseUrl = flags['callback-url'] || this.cliConfig.serverUrl; const oneTimeTokens: Record = {}; if (flags['github-token']) oneTimeTokens.github = flags['github-token']; diff --git a/src/cli/dashboard/webhooks/delete.ts b/src/cli/dashboard/webhooks/delete.ts index 04a10820..dfc64909 100644 --- a/src/cli/dashboard/webhooks/delete.ts +++ b/src/cli/dashboard/webhooks/delete.ts @@ -28,7 +28,7 @@ export default class WebhooksDelete extends DashboardCommand { const { args, flags } = await this.parse(WebhooksDelete); try { - const callbackBaseUrl = flags['callback-url'] || this.config_.serverUrl; + const callbackBaseUrl = flags['callback-url'] || this.cliConfig.serverUrl; const oneTimeTokens: Record = {}; if (flags['github-token']) oneTimeTokens.github = flags['github-token']; diff --git a/src/cli/dashboard/webhooks/list.ts b/src/cli/dashboard/webhooks/list.ts index 42eaa0ec..495f90cc 100644 --- a/src/cli/dashboard/webhooks/list.ts +++ b/src/cli/dashboard/webhooks/list.ts @@ -33,7 +33,7 @@ export default class WebhooksList extends DashboardCommand { const result = await this.client.webhooks.list.query({ projectId: args.projectId, - callbackBaseUrl: this.config_.serverUrl || undefined, + callbackBaseUrl: this.cliConfig.serverUrl || undefined, oneTimeTokens: Object.keys(oneTimeTokens).length > 0 ? oneTimeTokens : undefined, });