gitea-ci: detectar correctamente si ya se bajó la repo
This commit is contained in:
parent
846ff055fa
commit
6d074c41f3
1 changed files with 1 additions and 1 deletions
|
@ -185,7 +185,7 @@ func (h webhook) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var cmd *exec.Cmd
|
var cmd *exec.Cmd
|
||||||
if _, err = os.ReadDir(path.Join(src, ".git")); os.IsExist(err) {
|
if entries, _ := os.ReadDir(path.Join(src, ".git")); len(entries) > 0 {
|
||||||
cmd = exec.Command("git", "pull")
|
cmd = exec.Command("git", "pull")
|
||||||
cmd.Dir = src
|
cmd.Dir = src
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue