Skip to content

Commit

Permalink
set the working dir when getting latest
Browse files Browse the repository at this point in the history
  • Loading branch information
djeebus committed Jan 19, 2024
1 parent fd808c9 commit 386501e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/local/gitRepos.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 386501e

Please sign in to comment.