@@ -53,6 +53,12 @@ export async function runCreateInteractiveCli(): Promise<CreateAppResult> {
53
53
54
54
const backgroundInstall = backgroundInstallDeps ( pkgManager , baseApp ) ;
55
55
56
+ const cancelProcess = async ( ) => {
57
+ await backgroundInstall . abort ( ) ;
58
+ cancel ( 'Operation cancelled.' ) ;
59
+ process . exit ( 0 ) ;
60
+ } ;
61
+
56
62
log . info ( `Creating new project in ${ bgBlue ( ' ' + outDir + ' ' ) } ... 🐇` ) ;
57
63
58
64
let removeExistingOutDirPromise : Promise < void | void [ ] > | null = null ;
@@ -70,8 +76,7 @@ export async function runCreateInteractiveCli(): Promise<CreateAppResult> {
70
76
} ) ;
71
77
72
78
if ( isCancel ( existingOutDirAnswer ) || existingOutDirAnswer === 'exit' ) {
73
- cancel ( 'Operation cancelled.' ) ;
74
- process . exit ( 0 ) ;
79
+ return await cancelProcess ( ) ;
75
80
}
76
81
77
82
if ( existingOutDirAnswer === 'replace' ) {
@@ -86,8 +91,7 @@ export async function runCreateInteractiveCli(): Promise<CreateAppResult> {
86
91
} ) ;
87
92
88
93
if ( isCancel ( starterIdAnswer ) ) {
89
- cancel ( 'Operation cancelled.' ) ;
90
- process . exit ( 0 ) ;
94
+ return await cancelProcess ( ) ;
91
95
}
92
96
93
97
const starterId = starterIdAnswer as string ;
@@ -98,8 +102,7 @@ export async function runCreateInteractiveCli(): Promise<CreateAppResult> {
98
102
} ) ;
99
103
100
104
if ( isCancel ( runDepInstallAnswer ) ) {
101
- cancel ( 'Operation cancelled.' ) ;
102
- process . exit ( 0 ) ;
105
+ return await cancelProcess ( ) ;
103
106
}
104
107
105
108
const gitInitAnswer = await confirm ( {
0 commit comments