Skip to content

Commit 1fc32ab

Browse files
authored
fix: Remove .post-create before committing (#1018)
1 parent 49c6b13 commit 1fc32ab

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

packages/create-project/src/create-project.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -187,22 +187,23 @@ export async function createApp({
187187

188188
console.log();
189189

190-
if (await tryGitInit(root, gitInit)) {
191-
console.log('Initialized a git repository.');
192-
}
193-
194190
const messageFile = path.join(root, '.post-create');
195191

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-
202192
try {
203193
await access(messageFile);
204194
const message = await readFile(messageFile, 'utf8');
205195

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+
206207
// Hack for creating a TemplateStringsArray
207208
// Required by chalk-template
208209
class MockTemplateString extends Array implements TemplateStringsArray {
@@ -211,7 +212,6 @@ export async function createApp({
211212
}
212213
}
213214
console.log(chalkTemplate(new MockTemplateString([message])));
214-
await rm(messageFile);
215215
} catch (error) {
216216
const code = getErrorCode(error);
217217
if (code !== 'ENOENT') {

0 commit comments

Comments
 (0)