fix: join path correctly
continuous-integration/drone/push Build is passing Details

This commit is contained in:
decentral1se 2021-12-11 20:01:30 +01:00
parent 870c561fee
commit 665396b679
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
1 changed files with 8 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package git
import (
"io/ioutil"
"os"
"os/user"
"path"
"path/filepath"
@ -93,7 +94,13 @@ func parseGitConfig() (*gitConfigPkg.Config, error) {
return nil, err
}
b, err := ioutil.ReadFile(usr.HomeDir + "/.gitconfig")
globalGitConfig := filepath.Join(usr.HomeDir, ".gitconfig")
if _, err := os.Stat(globalGitConfig); os.IsNotExist(err) {
logrus.Debugf("no %s exists, not reading any global git ignore config", globalGitConfig)
return cfg, nil
}
b, err := ioutil.ReadFile(globalGitConfig)
if err != nil {
return nil, err
}