Skip to content

Commit 9499582

Browse files
committed
feat: initialize git repo after project creation
1 parent 9bf32f2 commit 9499582

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/create.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ export default async function create(argv: yargs.Arguments<any>) {
6969
type: 'input',
7070
name: 'description',
7171
message: 'What is the description for the package?',
72-
validate: input => Boolean(input),
7372
},
7473
{
7574
type: 'input',
@@ -177,6 +176,15 @@ export default async function create(argv: yargs.Arguments<any>) {
177176

178177
await copyDir(TEMPLATE, folder);
179178

179+
try {
180+
await child_process.execSync(
181+
'git init && git add . && git commit -m "chore: initial commit"',
182+
{ cwd: folder }
183+
);
184+
} catch (e) {
185+
// Ignore error
186+
}
187+
180188
console.log(
181189
dedent(chalk`
182190
Project created successfully at {blue ${argv.name}}!

0 commit comments

Comments
 (0)