fix: join path correctly
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
870c561fee
commit
665396b679
|
@ -2,6 +2,7 @@ package git
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"os"
|
||||||
"os/user"
|
"os/user"
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
@ -93,7 +94,13 @@ func parseGitConfig() (*gitConfigPkg.Config, error) {
|
||||||
return nil, err
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue