Skip to content

Commit 28d5ed4

Browse files
author
deepshekhardas
committed
fix(cli): rename DEFFAULT_PROFILE to DEFAULT_PROFILE and fix init command suggestion
1 parent af3bb34 commit 28d5ed4

File tree

3 files changed

+21
-22
lines changed

3 files changed

+21
-22
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,8 @@ async function _initCommand(dir: string, options: InitCommandOptions) {
257257
log.info("Next steps:");
258258
log.info(
259259
` 1. To start developing, run ${chalk.green(
260-
`npx trigger.dev@${cliTag} dev${options.profile ? "" : ` --profile ${options.profile}`}`
260+
`npx trigger.dev@${cliTag} dev${options.profile && options.profile !== "default" ? ` --profile ${options.profile}` : ""
261+
}`
261262
)} in your project directory`
262263
);
263264
log.info(` 2. Visit your ${projectDashboard} to view your newly created tasks.`);
@@ -541,11 +542,11 @@ class CLIInstallPackagesOutputter implements InstallPackagesOutputter {
541542
}
542543

543544
class SilentInstallPackagesOutputter implements InstallPackagesOutputter {
544-
startSDK() {}
545-
installedSDK() {}
546-
startBuild() {}
547-
installedBuild() {}
548-
stoppedWithError() {}
545+
startSDK() { }
546+
installedSDK() { }
547+
startBuild() { }
548+
installedBuild() { }
549+
stoppedWithError() { }
549550
}
550551

551552
export async function installPackages(

packages/cli-v3/src/utilities/configFiles.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function getGlobalConfigFolderPath() {
1111
return configDir;
1212
}
1313

14-
export const DEFFAULT_PROFILE = "default";
14+
export const DEFAULT_PROFILE = "default";
1515

1616
const CONFIG_FILE = "config.json";
1717
const OLD_CONFIG_FILE = "default.json";
@@ -27,7 +27,7 @@ type OldCliConfigFile = z.infer<typeof OldCliConfigFile>;
2727

2828
const CliConfigFile = z.object({
2929
version: z.literal(2),
30-
currentProfile: z.string().default(DEFFAULT_PROFILE),
30+
currentProfile: z.string().default(DEFAULT_PROFILE),
3131
profiles: z.record(CliConfigProfileSettings),
3232
settings: z
3333
.object({
@@ -55,7 +55,7 @@ function getAuthConfigFileBackupPath() {
5555
function getBlankConfig(): CliConfigFile {
5656
return {
5757
version: 2,
58-
currentProfile: DEFFAULT_PROFILE,
58+
currentProfile: DEFAULT_PROFILE,
5959
profiles: {},
6060
settings: {
6161
hasSeenMCPInstallPrompt: false,
@@ -83,7 +83,7 @@ export function readAuthConfigCurrentProfileName(): string {
8383

8484
export function writeAuthConfigProfile(
8585
settings: CliConfigProfileSettings,
86-
profile: string = DEFFAULT_PROFILE
86+
profile: string = DEFAULT_PROFILE
8787
) {
8888
const config = getConfig();
8989

@@ -93,7 +93,7 @@ export function writeAuthConfigProfile(
9393
}
9494

9595
export function readAuthConfigProfile(
96-
profile: string = DEFFAULT_PROFILE
96+
profile: string = DEFAULT_PROFILE
9797
): CliConfigProfileSettings | undefined {
9898
try {
9999
const config = getConfig();
@@ -150,13 +150,13 @@ export function writeConfigLastRulesInstallPromptVersion(version: string) {
150150
writeAuthConfigFile(config);
151151
}
152152

153-
export function deleteAuthConfigProfile(profile: string = DEFFAULT_PROFILE) {
153+
export function deleteAuthConfigProfile(profile: string = DEFAULT_PROFILE) {
154154
const config = getConfig();
155155

156156
delete config.profiles[profile];
157157

158158
if (config.currentProfile === profile) {
159-
config.currentProfile = DEFFAULT_PROFILE;
159+
config.currentProfile = DEFAULT_PROFILE;
160160
}
161161

162162
writeAuthConfigFile(config);
@@ -182,7 +182,7 @@ export function readAuthConfigFile(): CliConfigFile | null {
182182

183183
const newConfigFormat = {
184184
version: 2,
185-
currentProfile: DEFFAULT_PROFILE,
185+
currentProfile: DEFAULT_PROFILE,
186186
profiles: oldConfigFormat,
187187
} satisfies CliConfigFile;
188188

packages/cli-v3/src/utilities/initialBanner.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { chalkGrey, chalkRun, chalkTask, chalkWorker, logo } from "./cliOutput.j
55
import { logger } from "./logger.js";
66
import { spinner } from "./windows.js";
77
import {
8-
DEFFAULT_PROFILE,
8+
DEFAULT_PROFILE,
99
readAuthConfigCurrentProfileName,
1010
readAuthConfigProfile,
1111
} from "./configFiles.js";
@@ -15,21 +15,19 @@ function getProfileInfo(profileName?: string) {
1515
const currentProfile = profileName ?? readAuthConfigCurrentProfileName();
1616
const profile = readAuthConfigProfile(currentProfile);
1717

18-
if (currentProfile === DEFFAULT_PROFILE || !profile) {
18+
if (currentProfile === DEFAULT_PROFILE || !profile) {
1919
return;
2020
}
2121

22-
return `Profile: ${currentProfile}${
23-
profile.apiUrl === CLOUD_API_URL ? "" : ` - ${profile.apiUrl}`
24-
}`;
22+
return `Profile: ${currentProfile}${profile.apiUrl === CLOUD_API_URL ? "" : ` - ${profile.apiUrl}`
23+
}`;
2524
}
2625

2726
export async function printInitialBanner(performUpdateCheck = true, profile?: string) {
2827
const profileInfo = getProfileInfo(profile);
2928

30-
const text = `\n${logo()} ${chalkGrey(`(${VERSION})`)}${
31-
profileInfo ? chalkGrey(` | ${profileInfo}`) : ""
32-
}\n`;
29+
const text = `\n${logo()} ${chalkGrey(`(${VERSION})`)}${profileInfo ? chalkGrey(` | ${profileInfo}`) : ""
30+
}\n`;
3331

3432
logger.info(text);
3533

0 commit comments

Comments
 (0)