Skip to content

Commit 8d6d4ff

Browse files
committed
make init default to cli version for all packages
1 parent 217fdee commit 8d6d4ff

File tree

1 file changed

+7
-5
lines changed
  • packages/cli-v3/src/commands

1 file changed

+7
-5
lines changed

packages/cli-v3/src/commands/init.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,15 @@ import { printStandloneInitialBanner } from "../utilities/initialBanner.js";
3232
import { logger } from "../utilities/logger.js";
3333
import { spinner } from "../utilities/windows.js";
3434
import { login } from "./login.js";
35+
import { VERSION } from "../version.js";
36+
37+
const cliVersion = VERSION as string;
38+
const cliTag = cliVersion.includes("v4-beta") ? "v4-beta" : "latest";
3539

3640
const InitCommandOptions = CommonCommandOptions.extend({
3741
projectRef: z.string().optional(),
3842
overrideConfig: z.boolean().default(false),
39-
// TODO: Revert this to "latest" once we have a stable release
40-
tag: z.string().default("v4-beta"),
43+
tag: z.string().default(cliVersion),
4144
skipPackageInstall: z.boolean().default(false),
4245
runtime: z.string().default("node"),
4346
pkgArgs: z.string().optional(),
@@ -61,8 +64,7 @@ export function configureInitCommand(program: Command) {
6164
.option(
6265
"-t, --tag <package tag>",
6366
"The version of the @trigger.dev/sdk package to install",
64-
// TODO: Revert this to "latest" once we have a stable release
65-
"v4-beta"
67+
cliVersion
6668
)
6769
.option(
6870
"-r, --runtime <runtime>",
@@ -195,7 +197,7 @@ async function _initCommand(dir: string, options: InitCommandOptions) {
195197
log.info("Next steps:");
196198
log.info(
197199
` 1. To start developing, run ${chalk.green(
198-
`npx trigger.dev@${options.tag} dev${options.profile ? "" : ` --profile ${options.profile}`}`
200+
`npx trigger.dev@${cliTag} dev${options.profile ? "" : ` --profile ${options.profile}`}`
199201
)} in your project directory`
200202
);
201203
log.info(` 2. Visit your ${projectDashboard} to view your newly created tasks.`);

0 commit comments

Comments
 (0)