From 7bbf07e7e6d49c64c1e58d42fa2743321f14fd8c Mon Sep 17 00:00:00 2001 From: zricethezav Date: Sun, 4 Mar 2018 20:42:25 -0600 Subject: [PATCH] chdir for local repo mode --- repo.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/repo.go b/repo.go index 94ee0dd4..9044c14a 100644 --- a/repo.go +++ b/repo.go @@ -111,6 +111,10 @@ func (repo *Repo) audit() (bool, error) { } } else { log.Printf("fetching \x1b[37;1m%s\x1b[0m from %s ...\n", repo.name, repo.path) + err = os.Chdir(fmt.Sprintf(repo.path)) + if err != nil { + return false, fmt.Errorf("cannot navigate to %s", repo.path) + } err = exec.Command("git", "fetch").Run() if err != nil { return false, fmt.Errorf("cannot fetch %s from %s", repo.url, repo.path)