From 386501e19bf66e883bccde26380bb73e1f733ba0 Mon Sep 17 00:00:00 2001 From: djeebus Date: Fri, 19 Jan 2024 16:15:59 -0500 Subject: [PATCH] set the working dir when getting latest --- pkg/local/gitRepos.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/local/gitRepos.go b/pkg/local/gitRepos.go index b8603bb8..af659515 100644 --- a/pkg/local/gitRepos.go +++ b/pkg/local/gitRepos.go @@ -60,15 +60,16 @@ func (rd *ReposDirectory) Register(ctx context.Context, cloneUrl string) string repoDir, ok = rd.paths[cloneUrl] if ok { - rd.fetchLatest() + rd.fetchLatest(repoDir) return repoDir } return rd.clone(ctx, cloneUrl) } -func (rd *ReposDirectory) fetchLatest() { +func (rd *ReposDirectory) fetchLatest(repoDir string) { cmd := exec.Command("git", "pull") + cmd.Dir = repoDir cmd.Stdout = os.Stdout cmd.Stderr = os.Stdout err := cmd.Run()