mirror of
https://github.com/Jguer/yay.git
synced 2024-11-06 09:07:21 +01:00
Set GIT_TERMINAL_PROMPT=0 for clone and fetch
This commit is contained in:
parent
161bc1a17a
commit
297bf31cdf
@ -60,7 +60,9 @@ func gitHasDiff(path string, name string) (bool, error) {
|
||||
func gitDownload(url string, path string, name string) (bool, error) {
|
||||
_, err := os.Stat(filepath.Join(path, name, ".git"))
|
||||
if os.IsNotExist(err) {
|
||||
_, stderr, err := capture(passToGit(path, "clone", "--no-progress", url, name))
|
||||
cmd := passToGit(path, "clone", "--no-progress", url, name)
|
||||
cmd.Env = append(os.Environ(), "GIT_TERMINAL_PROMPT=0")
|
||||
_, stderr, err := capture(cmd)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("error cloning %s: stderr", name, stderr)
|
||||
}
|
||||
@ -70,7 +72,9 @@ func gitDownload(url string, path string, name string) (bool, error) {
|
||||
return false, fmt.Errorf("error reading %s", filepath.Join(path, name, ".git"))
|
||||
}
|
||||
|
||||
_, stderr, err := capture(passToGit(filepath.Join(path, name), "fetch"))
|
||||
cmd := passToGit(filepath.Join(path, name), "fetch")
|
||||
cmd.Env = append(os.Environ(), "GIT_TERMINAL_PROMPT=0")
|
||||
_, stderr, err := capture(cmd)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("error fetching %s: %s", name, stderr)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user