@@ -22,7 +22,11 @@ import {
22
22
import { EnvironmentVariablesWithAuth } from '../types/generic' ;
23
23
import { fileExists , readFile } from '../utils/fs' ;
24
24
import { CliInfo } from './types' ;
25
- import { deprecateProjectName , getFullCommand } from './utils' ;
25
+ import {
26
+ constructCommandName ,
27
+ deprecateProjectName ,
28
+ getFullCommand ,
29
+ } from './utils' ;
26
30
27
31
const log = debug ( 'twilio-run:deploy' ) ;
28
32
@@ -147,18 +151,24 @@ function handleError(
147
151
log ( '%O' , err ) ;
148
152
spinner . fail ( 'Failed Deployment' ) ;
149
153
if ( err . name === 'conflicting-servicename' ) {
154
+ const fullCommand = getFullCommand ( flags ) ;
150
155
const messageBody = stripIndent `
151
156
Here are a few ways to solve this problem:
152
157
153
158
- Rename your project in the package.json "name" property
154
159
- Pass an explicit name to your deployment
155
- > ${ flags . $0 } deploy -n my-new-service-name
160
+ > ${ constructCommandName ( fullCommand , 'deploy' , [
161
+ '-n' ,
162
+ 'my-new-service-name' ,
163
+ ] ) }
156
164
- Deploy to the existing service with the name "${ ( err as any ) [
157
165
'serviceName'
158
166
] || config . serviceName } "
159
- > ${ flags . $0 } deploy --override-existing-project
167
+ > ${ constructCommandName ( fullCommand , 'deploy' , [
168
+ '--override-existing-project' ,
169
+ ] ) }
160
170
- Run deployment in force mode
161
- > ${ flags . $0 } deploy --force
171
+ > ${ constructCommandName ( fullCommand , ' deploy' , [ ' --force' ] ) }
162
172
` ;
163
173
console . error ( errorMessage ( err . message , messageBody ) ) ;
164
174
} else if ( err . name === 'HTTPError' ) {
0 commit comments