Skip to content

Commit

Permalink
feat(sync): deprecate non-interactive sync start and stop commands (
Browse files Browse the repository at this point in the history
#5747)

* improvement(sync): deprecate non-interactive `sync start` command

Recommend to run it from inside dev console.

* chore: simplified conditional expression
  • Loading branch information
vvagaytsev authored Mar 4, 2024
1 parent 9a82700 commit 6e1e979
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/commands/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export class DeployCommand extends Command<Args, Opts> {
}

override useInkTerminalWriter(params) {
return !!this.maybePersistent(params)
return this.maybePersistent(params)
}

override terminate() {
Expand Down
12 changes: 12 additions & 0 deletions core/src/commands/sync/sync-start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -95,6 +96,17 @@ export class SyncStartCommand extends Command<Args, Opts> {
async action(params: CommandParams<Args, Opts>): Promise<CommandResult<{}>> {
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 || ["*"]

Expand Down

0 comments on commit 6e1e979

Please sign in to comment.