-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
check git configuration before exec world create
- Loading branch information
Showing
1 changed file
with
9 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,14 @@ type GitCloneFinishMsg struct { | |
|
||
func git(args ...string) (string, error) { | ||
var outBuff, errBuff bytes.Buffer | ||
_, err := sh.Exec(nil, &outBuff, &errBuff, "git", args...) | ||
|
||
// Define environment variables | ||
env := map[string]string{ | ||
"GIT_COMMITTER_NAME": "World CLI", | ||
"GIT_COMMITTER_EMAIL": "[email protected]", | ||
} | ||
|
||
_, err := sh.Exec(env, &outBuff, &errBuff, "git", args...) | ||
if err != nil { | ||
return "", err | ||
} | ||
|
@@ -94,7 +101,7 @@ func GitCloneCmd(url string, targetDir string, initMsg string) error { | |
return err | ||
} | ||
|
||
_, err = git("commit", "-m", initMsg) | ||
_, err = git("commit", "--author=\"World CLI <[email protected]>\"", "-m", initMsg) | ||
if err != nil { | ||
return err | ||
} | ||
|