@@ -117,14 +117,24 @@ export async function cli(args) {
117
117
118
118
// detect if we are on google cloud :)
119
119
120
- const checkGoogleCloud = await runHelperScript ( "detectGoogleCloud " ) ;
120
+ const checkCloudShell = await runHelperScript ( "detectCloudShell " ) ;
121
121
122
- if ( ! argv . method && checkGoogleCloud && checkGoogleCloud == "true" ) {
123
- argv . method == "gcloud" ;
124
- console . log (
125
- "Auto-detected you are on Google Cloud, so we'll deploy there 🚀\nYou can manually change this by executing with --method"
126
- ) ;
127
- } else if ( argv . method == undefined ) {
122
+ if ( ! argv . method && checkCloudShell && checkCloudShell == "true" ) {
123
+ console . log ( "It looks like you are using Google Cloud Shell 🚀" ) ;
124
+
125
+ const gcloudCheck = await inquirer . prompt ( {
126
+ type : "confirm" ,
127
+ default : true ,
128
+ name : "confirm" ,
129
+ message : "Do you want to deploy a new Coder cluster?" ,
130
+ } ) ;
131
+
132
+ if ( gcloudCheck . confirm ) {
133
+ argv . method = "gcloud" ;
134
+ }
135
+ }
136
+
137
+ if ( argv . method == undefined ) {
128
138
argv = {
129
139
...argv ,
130
140
...( await inquirer . prompt ( {
@@ -149,7 +159,6 @@ export async function cli(args) {
149
159
// ensure gcloud-cli is installed and active
150
160
151
161
// TODO: add better user education on what the prereqs are
152
- console . log ( "Checking for prerequisites..." ) ;
153
162
try {
154
163
await runHelperScript ( "googleCloudPrereqs" ) ;
155
164
console . log ( "✅" , "You seem to have all the dependencies installed!" ) ;
0 commit comments