Skip to content

Commit

Permalink
fix(create-analog): fail silent when commit cannot be created (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
unrevised6419 authored Aug 30, 2022
1 parent bdc51fb commit 4a66a0c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/create-analog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,13 @@ async function init() {
write('package.json', JSON.stringify(pkg, null, 2));

console.log(`\nInitializing git repository:`);
execSync(
`git init ${targetDir} && cd ${targetDir} && git add . && git commit -m "initial commit"`
);
execSync(`git init ${targetDir} && cd ${targetDir} && git add .`);

// Fail Silent
// Can fail when user does not have global git credentials
try {
execSync(`git commit -m "initial commit"`);
} catch {}

console.log(`\nDone. Now run:\n`);
if (root !== cwd) {
Expand Down

0 comments on commit 4a66a0c

Please sign in to comment.