Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(create-remix): add fallback git author to initial commit #10115

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@
- kishanhitk
- kiyadotdev
- klauspaiva
- klibardi
- klirium
- knowler
- konradkalemba
Expand Down
16 changes: 15 additions & 1 deletion packages/create-remix/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,10 +507,24 @@ async function gitInitStep(ctx: Context) {
while: async () => {
let options = { cwd: ctx.cwd, stdio: "ignore" } as const;
let commitMsg = "Initial commit from create-remix";
const commitUser = "create-remix";
const commitEmail = "<>"
Comment on lines +510 to +511
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be the fallback and we should use the available global defaults first

try {
await execa("git", ["init"], options);
await execa("git", ["add", "."], options);
await execa("git", ["commit", "-m", commitMsg], options);
await execa(
"git",
[
"-c",
`user.name='${commitUser}'`,
"-c",
`user.email='${commitEmail}'`,
"commit",
"-m",
commitMsg
],
options
);
} catch (err) {
error("Oh no!", "Failed to initialize git.");
throw err;
Expand Down