@@ -565,7 +565,7 @@ export const groupMultiselect = <Value>(opts: GroupMultiSelectOptions<Value>) =>
565
565
} ;
566
566
567
567
const strip = ( str : string ) => str . replace ( ansiRegex ( ) , '' ) ;
568
- export const note = ( message = '' , title = '' ) => {
568
+ export const note = ( message = '' , title = '' , code : number = 0 ) => {
569
569
const lines = `\n${ message } \n` . split ( '\n' ) ;
570
570
const titleLen = strip ( title ) . length ;
571
571
const len =
@@ -584,8 +584,12 @@ export const note = (message = '', title = '') => {
584
584
) } `
585
585
)
586
586
. join ( '\n' ) ;
587
+ const step =
588
+ code === 0
589
+ ? color . green ( S_STEP_SUBMIT )
590
+ : color . green ( S_SUCCESS )
587
591
process . stdout . write (
588
- `${ color . gray ( S_BAR ) } \n${ color . green ( S_STEP_SUBMIT ) } ${ color . reset ( title ) } ${ color . gray (
592
+ `${ color . gray ( S_BAR ) } \n${ step } ${ color . reset ( title ) } ${ color . gray (
589
593
S_BAR_H . repeat ( Math . max ( len - titleLen - 1 , 1 ) ) + S_CORNER_TOP_RIGHT
590
594
) } \n${ msg } \n${ color . gray ( S_CONNECT_LEFT + S_BAR_H . repeat ( len + 2 ) + S_CORNER_BOTTOM_RIGHT ) } \n`
591
595
) ;
@@ -700,6 +704,8 @@ export const spinner = () => {
700
704
? color . green ( S_STEP_SUBMIT )
701
705
: code === 1
702
706
? color . red ( S_STEP_CANCEL )
707
+ : code === 2
708
+ ? color . green ( S_SUCCESS )
703
709
: color . red ( S_STEP_ERROR ) ;
704
710
process . stdout . write ( cursor . move ( - 999 , 0 ) ) ;
705
711
process . stdout . write ( erase . down ( 1 ) ) ;
0 commit comments