@@ -169,13 +169,26 @@ const STATUS_TO_PROGRESS_VALUE: Record<keyof typeof DeploymentStatusTypesSchema,
169169 [ DeploymentStatusTypesSchema . successful ] : PROGRESS_STEP * 100 ,
170170} ;
171171
172+ const setCustomTip = ( tip ?: string , color = 'green' ) => {
173+ let chalkColor = chalk . green ;
174+ switch ( color ) {
175+ case 'yellow' : {
176+ chalkColor = chalk . yellow ;
177+ break ;
178+ }
179+ }
180+
181+ return tip ? `\n ${ chalk . italic ( chalkColor ( tip ) ) } ` : '' ;
182+ } ;
183+
172184const finalizeDeployment = (
173185 deploymentStatus : AppVersionDeploymentStatus ,
174186 task : ListrTaskWrapper < PushCommandTasksContext , any > ,
175187) => {
176188 switch ( deploymentStatus . status ) {
177189 case DeploymentStatusTypesSchema . failed : {
178- task . title = deploymentStatus . error ?. message || 'Deployment process has failed' ;
190+ const customTip = setCustomTip ( deploymentStatus . tip , 'yellow' ) ;
191+ task . title = ( deploymentStatus . error ?. message . trimStart ( ) || 'Deployment process has failed' ) + customTip ;
179192 throw new Error ( task . title ) ;
180193 }
181194
@@ -206,7 +219,7 @@ export const handleDeploymentTask = async (
206219 progressLogger : ( message : keyof typeof DeploymentStatusTypesSchema , tip ?: string ) => {
207220 const deltaInSeconds = ( Date . now ( ) - now ) / TimeInMs . second ;
208221 task . title = `Deployment in progress: ${ message } ` ;
209- const customTip = tip ? `\n ${ chalk . italic ( chalk . green ( tip ) ) } ` : '' ;
222+ const customTip = setCustomTip ( tip ) ;
210223 task . output =
211224 createProgressBarString ( MAX_PROGRESS_VALUE , STATUS_TO_PROGRESS_VALUE [ message ] , deltaInSeconds ) + customTip ;
212225 } ,
0 commit comments