Skip to content

Commit 2f923bc

Browse files
committed
refactor: app disconnect
1 parent 335f067 commit 2f923bc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/commands/app/deploy.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,18 @@ export default class Deploy extends AppCLIBaseCommand {
6969
this.sharedConfig.org = await this.getOrganization();
7070
const app = await this.fetchAppDetails();
7171

72+
const apolloClient = await this.getApolloClient();
73+
const projects = await getProjects(apolloClient);
74+
await this.handleAppDisconnect(projects);
75+
7276
flags["hosting-type"] = flags["hosting-type"] || (await getHostingType());
7377
const updateHostingPayload: UpdateHostingParams = {
7478
provider: "external",
7579
deployment_url: "",
7680
};
77-
const apolloClient = await this.getApolloClient();
78-
const projects = await getProjects(apolloClient);
7981

8082
switch (flags["hosting-type"]) {
8183
case "Custom Hosting":
82-
await this.handleAppDisconnect(projects);
8384
flags["app-url"] = flags["app-url"] || (await getAppUrl());
8485
this.flags["app-url"] = formatUrl(flags["app-url"]);
8586
updateHostingPayload["deployment_url"] = this.flags["app-url"];
@@ -88,7 +89,6 @@ export default class Deploy extends AppCLIBaseCommand {
8889
updateHostingPayload["provider"] = "launch";
8990
const config = setupConfig(flags["config"]);
9091
config["name"] = config["name"] || app?.name;
91-
await this.handleAppDisconnect(projects);
9292
this.flags["launch-project"] =
9393
this.flags["launch-project"] || (await askProjectType());
9494
await this.handleHostingWithLaunch(config, updateHostingPayload, projects);

0 commit comments

Comments
 (0)