diff options
Diffstat (limited to 'git.go')
| -rw-r--r-- | git.go | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -20,6 +20,10 @@ func (rs *RepoStatus) GetCurrentBranchVersion() string { return rs.currentVersion.String() } +func (rs *RepoStatus) LastGitPull() (time.Time, error) { + return rs.mtime(".git/FETCH_HEAD") +} + func (rs *RepoStatus) Age() time.Duration { var t *Tag t = rs.NewestTag() @@ -35,6 +39,19 @@ func (rs *RepoStatus) Age() time.Duration { return time.Since(tagTime) } +func (rs *RepoStatus) GitPull() error { + var cmd []string + cmd = append(cmd, "git", "pull") + err, _, output := RunCmd(rs.realPath.String(), cmd) + if err == nil { + log.Log(REPOWARN,"git pull ran", rs.Path()) + log.Log(REPOWARN,"git pull output", output) + } else { + log.Log(REPOWARN,"git pull error", rs.Path(), err) + } + return err +} + /* // this isn't right func (rs *RepoStatus) LastTagAge() (time.Time, string) { |
