Skip to content

Commit 335f067

Browse files
committed
refactor: launch project flag
1 parent 09754e4 commit 335f067

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

src/commands/app/deploy.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ export default class Deploy extends AppCLIBaseCommand {
3131
"$ <%= config.bin %> <%= command.id %>",
3232
"$ <%= config.bin %> <%= command.id %> --org <UID> --app-uid <APP-UID-1>",
3333
"$ <%= config.bin %> <%= command.id %> --org <UID> --app-uid <APP-UID-1> --hosting-type <Custom Hosting> --app-url <https://localhost:3000>",
34-
"$ <%= config.bin %> <%= command.id %> --org <UID> --app-uid <APP-UID-1> --hosting-type <Hosting with Launch> --launch-project-type <existing-project>",
35-
"$ <%= config.bin %> <%= command.id %> --org <UID> --app-uid <APP-UID-1> --hosting-type <Hosting with Launch> --launch-project-type <new-project>",
36-
"$ <%= config.bin %> <%= command.id %> --org <UID> --app-uid <APP-UID-1> --hosting-type <Hosting with Launch> --launch-project-type <new-project> --config <config-path>",
34+
"$ <%= config.bin %> <%= command.id %> --org <UID> --app-uid <APP-UID-1> --hosting-type <Hosting with Launch> --launch-project <existing>",
35+
"$ <%= config.bin %> <%= command.id %> --org <UID> --app-uid <APP-UID-1> --hosting-type <Hosting with Launch> --launch-project <new>",
36+
"$ <%= config.bin %> <%= command.id %> --org <UID> --app-uid <APP-UID-1> --hosting-type <Hosting with Launch> --launch-project <new> --config <config-path>",
3737
];
3838

3939
static flags: FlagInput = {
@@ -51,10 +51,10 @@ export default class Deploy extends AppCLIBaseCommand {
5151
description: deployAppMsg.FORCE_DISCONNECT,
5252
default: false,
5353
}),
54-
"launch-project-type": Flags.string({
54+
"launch-project": Flags.string({
5555
multiple: false,
56-
options: ["existing-project", "new-project"],
57-
description: deployAppMsg.LAUNCH_PROJECT_TYPE,
56+
options: ["existing", "new"],
57+
description: deployAppMsg.LAUNCH_PROJECT,
5858
}),
5959
config: Flags.string({
6060
char: "c",
@@ -89,8 +89,8 @@ export default class Deploy extends AppCLIBaseCommand {
8989
const config = setupConfig(flags["config"]);
9090
config["name"] = config["name"] || app?.name;
9191
await this.handleAppDisconnect(projects);
92-
this.flags["launch-project-type"] =
93-
this.flags["launch-project-type"] || (await askProjectType());
92+
this.flags["launch-project"] =
93+
this.flags["launch-project"] || (await askProjectType());
9494
await this.handleHostingWithLaunch(config, updateHostingPayload, projects);
9595
break;
9696
default:
@@ -190,9 +190,9 @@ export default class Deploy extends AppCLIBaseCommand {
190190
): Promise<void> {
191191
let url: string = "";
192192

193-
if (this.flags["launch-project-type"] === "existing-project") {
193+
if (this.flags["launch-project"] === "existing") {
194194
url = await this.handleExistingProject(updateHostingPayload, projects);
195-
} else if (this.flags["launch-project-type"] === "new-project") {
195+
} else if (this.flags["launch-project"] === "new") {
196196
config["name"] = await handleProjectNameConflict(
197197
config["name"],
198198
projects

src/messages/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ const reinstallAppMsg = {
115115
const deployAppMsg = {
116116
APP_DEPLOYED: "{app} deployed successfully.",
117117
FORCE_DISCONNECT: "Force disconnect launch project by skipping the confirmation",
118-
LAUNCH_PROJECT_TYPE: "Launch Project Type",
118+
LAUNCH_PROJECT: "Launch Project",
119119
APP_URL: "App URL",
120120
HOSTING_TYPE: "Hosting Type",
121121
CONFIG_FILE: "[optional] path of config file",

src/util/inquirer.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -349,11 +349,11 @@ async function selectProject(
349349
const askProjectType = async (): Promise<string> => {
350350
return await cliux.inquire<string>({
351351
type: "list",
352-
name: "selected_project_type",
353-
message: "Launch Project type",
352+
name: "selected_launch_project",
353+
message: "Launch Project",
354354
choices: [
355-
{ name: "Existing", value: "existing-project" },
356-
{ name: "New", value: "new-project" },
355+
{ name: "Existing", value: "existing" },
356+
{ name: "New", value: "new" },
357357
],
358358
});
359359
};

0 commit comments

Comments
 (0)