Skip to content

Commit

Permalink
fix: run git init when creating a new lib
Browse files Browse the repository at this point in the history
fixes #159
  • Loading branch information
aladdin-add committed Jul 5, 2022
1 parent 96db3e5 commit 5b9aee7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,12 @@ prog
Messages.installing(dependencies.sort())
).start();
try {
await execa('git', ['init']);
await execa('git', ['add', '.']);
const cmd = await getInstallCmd();
await execa(cmd, getInstallArgs(cmd, dependencies));
installSpinner.succeed('Installed dependencies');
await execa('git', ['commit', '-m', 'feat: first commit(by dts)']);
console.log(await Messages.start(pkg));
} catch (error) {
installSpinner.fail('Failed to install dependencies');
Expand Down

0 comments on commit 5b9aee7

Please sign in to comment.