From 6e1e979391c5e16aeb7d050115a563602790ffb5 Mon Sep 17 00:00:00 2001 From: Vladimir Vagaytsev Date: Mon, 4 Mar 2024 10:55:49 +0100 Subject: [PATCH] feat(sync): deprecate non-interactive `sync start` and `stop` commands (#5747) * improvement(sync): deprecate non-interactive `sync start` command Recommend to run it from inside dev console. * chore: simplified conditional expression --- core/src/commands/deploy.ts | 2 +- core/src/commands/sync/sync-start.ts | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/core/src/commands/deploy.ts b/core/src/commands/deploy.ts index fbbe6a3820..7f6828baf9 100644 --- a/core/src/commands/deploy.ts +++ b/core/src/commands/deploy.ts @@ -161,7 +161,7 @@ export class DeployCommand extends Command { } override useInkTerminalWriter(params) { - return !!this.maybePersistent(params) + return this.maybePersistent(params) } override terminate() { diff --git a/core/src/commands/sync/sync-start.ts b/core/src/commands/sync/sync-start.ts index d8af15a426..82d8067c09 100644 --- a/core/src/commands/sync/sync-start.ts +++ b/core/src/commands/sync/sync-start.ts @@ -20,6 +20,7 @@ import { createActionLog } from "../../logger/log-entry.js" import type { DeployAction } from "../../actions/deploy.js" import type { ConfigGraph } from "../../graph/config-graph.js" import type { Garden } from "../../index.js" +import { styles } from "../../logger/styles.js" const syncStartArgs = { names: new StringsParameter({ @@ -95,6 +96,17 @@ export class SyncStartCommand extends Command { async action(params: CommandParams): Promise> { const { garden, log, args, opts } = params + if (!params.parentCommand) { + log.warn( + dedent`Behaviour of ${styles.command( + "sync start" + )} is now deprecated and will be changed in a future breaking change release. + Instead we recommend running ${styles.command("garden deploy --sync")} or starting syncs ${styles.italic( + "inside" + )} the dev console with either ${styles.command("deploy --sync")} or ${styles.command("sync start")}.` + ) + } + // We default to starting syncs for all Deploy actions const names = args.names || ["*"]