gitea-ci: detectar correctamente si ya se bajó la repo

This commit is contained in:
Cat /dev/Nulo 2023-01-26 20:20:21 -03:00
parent 846ff055fa
commit 6d074c41f3
1 changed files with 1 additions and 1 deletions

View File

@ -185,7 +185,7 @@ func (h webhook) ServeHTTP(w http.ResponseWriter, req *http.Request) {
}
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.Dir = src
} else {