if specified, add api url to dev command shown after init

This commit is contained in:
nicktrn
2024-04-26 18:01:10 +01:00
parent 518cd98ad4
commit 4c3076bd9d
+6 -2
View File
@@ -30,6 +30,8 @@ import { logger } from "../utilities/logger";
import { cliRootPath } from "../utilities/resolveInternalFilePath";
import { login } from "./login";
import { spinner } from "../utilities/windows";
import { CLOUD_API_URL } from "../consts";
import * as packageJson from "../../package.json";
const InitCommandOptions = CommonCommandOptions.extend({
projectRef: z.string().optional(),
@@ -53,7 +55,7 @@ export function configureInitCommand(program: Command) {
.option(
"-t, --tag <package tag>",
"The version of the @trigger.dev/sdk package to install",
"beta"
packageJson.version
)
.option("--skip-package-install", "Skip installing the @trigger.dev/sdk package")
.option("--override-config", "Override the existing config file if it exists")
@@ -160,7 +162,9 @@ async function _initCommand(dir: string, options: InitCommandOptions) {
log.info("Next steps:");
log.info(
` 1. To start developing, run ${chalk.green(
`npx trigger.dev@${options.tag} dev`
`npx trigger.dev@${options.tag} dev${
options.apiUrl === CLOUD_API_URL ? "" : ` -a ${options.apiUrl}`
}`
)} in your project directory`
);
log.info(` 2. Visit your ${projectDashboard} to view your newly created tasks.`);