@@ -69,17 +69,18 @@ export default class Deploy extends AppCLIBaseCommand {
69
69
this . sharedConfig . org = await this . getOrganization ( ) ;
70
70
const app = await this . fetchAppDetails ( ) ;
71
71
72
+ const apolloClient = await this . getApolloClient ( ) ;
73
+ const projects = await getProjects ( apolloClient ) ;
74
+ await this . handleAppDisconnect ( projects ) ;
75
+
72
76
flags [ "hosting-type" ] = flags [ "hosting-type" ] || ( await getHostingType ( ) ) ;
73
77
const updateHostingPayload : UpdateHostingParams = {
74
78
provider : "external" ,
75
79
deployment_url : "" ,
76
80
} ;
77
- const apolloClient = await this . getApolloClient ( ) ;
78
- const projects = await getProjects ( apolloClient ) ;
79
81
80
82
switch ( flags [ "hosting-type" ] ) {
81
83
case "Custom Hosting" :
82
- await this . handleAppDisconnect ( projects ) ;
83
84
flags [ "app-url" ] = flags [ "app-url" ] || ( await getAppUrl ( ) ) ;
84
85
this . flags [ "app-url" ] = formatUrl ( flags [ "app-url" ] ) ;
85
86
updateHostingPayload [ "deployment_url" ] = this . flags [ "app-url" ] ;
@@ -88,7 +89,6 @@ export default class Deploy extends AppCLIBaseCommand {
88
89
updateHostingPayload [ "provider" ] = "launch" ;
89
90
const config = setupConfig ( flags [ "config" ] ) ;
90
91
config [ "name" ] = config [ "name" ] || app ?. name ;
91
- await this . handleAppDisconnect ( projects ) ;
92
92
this . flags [ "launch-project" ] =
93
93
this . flags [ "launch-project" ] || ( await askProjectType ( ) ) ;
94
94
await this . handleHostingWithLaunch ( config , updateHostingPayload , projects ) ;
0 commit comments