Skip to content

Commit 055dfd5

Browse files
committed
feat: git init after project downloaded
1 parent 601f33f commit 055dfd5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import path from 'node:path'
44
import process from 'node:process'
5+
import { exec } from 'node:child_process'
56
import { intro, note, outro, select, spinner, text } from '@clack/prompts'
67
import color from 'picocolors'
78
import degit from 'degit'
@@ -58,6 +59,8 @@ async function init() {
5859
const target: string = path.join(name as string || '.', '')
5960

6061
emitter.clone(target).then(async () => {
62+
const directory = path.resolve(process.cwd(), path.join('.', target))
63+
await exec('git init', { cwd: directory })
6164
s.stop(color.green(('Succeed!')))
6265
note(`cd ${target}\npnpm install\npnpm dev`, 'Next steps.')
6366
outro(`Problems? ${color.underline(color.cyan(`${bugs.url}`))}`)

0 commit comments

Comments
 (0)