File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed
packages/create-project/src Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -187,22 +187,23 @@ export async function createApp({
187
187
188
188
console . log ( ) ;
189
189
190
- if ( await tryGitInit ( root , gitInit ) ) {
191
- console . log ( 'Initialized a git repository.' ) ;
192
- }
193
-
194
190
const messageFile = path . join ( root , '.post-create' ) ;
195
191
196
- console . log ( ) ;
197
- console . log ( `${ chalk . green ( 'Success!' ) } Created project ${ chalk . bold ( appName ) } at:` ) ;
198
- console . log ( ) ;
199
- console . log ( chalk . bold ( appPath + '/' ) ) ;
200
- console . log ( ) ;
201
-
202
192
try {
203
193
await access ( messageFile ) ;
204
194
const message = await readFile ( messageFile , 'utf8' ) ;
205
195
196
+ await rm ( messageFile ) ;
197
+ if ( await tryGitInit ( root , gitInit ) ) {
198
+ console . log ( 'Initialized a git repository.' ) ;
199
+ }
200
+
201
+ console . log ( ) ;
202
+ console . log ( `${ chalk . green ( 'Success!' ) } Created project ${ chalk . bold ( appName ) } at:` ) ;
203
+ console . log ( ) ;
204
+ console . log ( chalk . bold ( appPath + '/' ) ) ;
205
+ console . log ( ) ;
206
+
206
207
// Hack for creating a TemplateStringsArray
207
208
// Required by chalk-template
208
209
class MockTemplateString extends Array implements TemplateStringsArray {
@@ -211,7 +212,6 @@ export async function createApp({
211
212
}
212
213
}
213
214
console . log ( chalkTemplate ( new MockTemplateString ( [ message ] ) ) ) ;
214
- await rm ( messageFile ) ;
215
215
} catch ( error ) {
216
216
const code = getErrorCode ( error ) ;
217
217
if ( code !== 'ENOENT' ) {
You can’t perform that action at this time.
0 commit comments