File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
packages/cli/src/command-helpers Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -18,11 +18,9 @@ export class PromptManager {
1818 // allows going back with Escape and returns the results
1919 async executeInteractive ( ) {
2020 let isCtrlC = false ;
21- // gluegun always throws empty string, so we have this workaround
21+ // gluegun always throws empty string so we don't know what caused the exception , so we need this workaround to handle Ctrl+C
2222 const keypressHandler = ( _ : string , key : { name : string ; ctrl : boolean } ) => {
23- if ( key . ctrl && key . name === 'c' ) {
24- isCtrlC = true ;
25- }
23+ isCtrlC = key . ctrl && key . name === 'c' ;
2624 } ;
2725 process . stdin . on ( 'keypress' , keypressHandler ) ;
2826
@@ -42,6 +40,7 @@ export class PromptManager {
4240 process . stdout . write ( '\x1b[1A\x1b[2K\x1b[1A\x1b[2K' ) ;
4341 this . currentStep -- ;
4442 while ( this . currentStep > 0 ) {
43+ delete this . results [ this . currentStep ] ;
4544 const skip = this . steps [ this . currentStep ] . skip ;
4645 const shouldSkip = typeof skip === 'function' ? await skip ( { } ) : skip ;
4746 if ( ! shouldSkip ) break ;
You can’t perform that action at this time.
0 commit comments