diff options
| author | Jeff Carr <[email protected]> | 2024-02-22 17:19:29 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-02-22 17:19:29 -0600 |
| commit | 359ebce26ee2223fdd05e8a04f75f15415ec0457 (patch) | |
| tree | aa2e82ec577d9abed0acb9138a43c13d40b76caa /git.go | |
| parent | cd5f1d9d0f52196d6ea07684a4307369893911bd (diff) | |
mtime
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) { |
