Skip to content

Commit

Permalink
fix(dev): don't init cloud API on no-project commands
Browse files Browse the repository at this point in the history
edvald committed Jun 14, 2023

Verified

This commit was signed with the committer’s verified signature.
Ana06 Ana María Martínez Gómez
1 parent 97e4d33 commit aff49fd
Showing 2 changed files with 13 additions and 9 deletions.
8 changes: 4 additions & 4 deletions core/src/server/commands.ts
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

import Joi from "@hapi/joi"
import type Joi from "@hapi/joi"
import { getLogLevelChoices, LoggerBase, LogLevel, ServerLogger, VoidLogger } from "../logger/logger"
import stringArgv from "string-argv"
import { Command, CommandParams, CommandResult, ConsoleCommand } from "../commands/base"
@@ -27,12 +27,12 @@ import type { GlobalConfigStore } from "../config-store/global"
import type { ParsedArgs } from "minimist"
import type { ServeCommand } from "../commands/serve"
import { uuidv4 } from "../util/random"
import { StatusCommandResult } from "../commands/get/get-status"
import type { StatusCommandResult } from "../commands/get/get-status"
import { omit } from "lodash"
import { sanitizeValue } from "../util/logging"
import { getSyncStatuses } from "../commands/sync/sync-status"
import { DeployStatus } from "../plugin/handlers/Deploy/get-status"
import { GetSyncStatusResult } from "../plugin/handlers/Deploy/get-sync-status"
import type { DeployStatus } from "../plugin/handlers/Deploy/get-status"
import type { GetSyncStatusResult } from "../plugin/handlers/Deploy/get-sync-status"

export interface CommandMap {
[key: string]: {
14 changes: 9 additions & 5 deletions core/src/server/instance-manager.ts
Original file line number Diff line number Diff line change
@@ -335,11 +335,15 @@ export class GardenInstanceManager {
environmentString?: string
sessionId: string
}) {
const cloudApi = await this.getCloudApi({
log,
cloudDomain: getGardenCloudDomain(projectConfig.domain),
globalConfigStore,
})
let cloudApi: CloudApi | undefined

if (!command?.noProject) {
cloudApi = await this.getCloudApi({
log,
cloudDomain: getGardenCloudDomain(projectConfig.domain),
globalConfigStore,
})
}

const gardenOpts: GardenOpts = {
cloudApi,

0 comments on commit aff49fd

Please sign in to comment.