Skip to content

Commit

Permalink
feat: Include last modified time of config file in doctor output
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed Jun 11, 2022
1 parent 56b05f0 commit 1af0576
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/cmd/doctorcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"sort"
"strings"
"text/tabwriter"
"time"

"github.com/coreos/go-semver/semver"
"github.com/google/go-github/v45/github"
Expand Down Expand Up @@ -474,7 +475,12 @@ func (c *configFileCheck) Run(system chezmoi.System, homeDirAbsPath chezmoi.AbsP
if _, err := system.ReadFile(filenameAbsPath); err != nil {
return checkResultError, fmt.Sprintf("%s: %v", filenameAbsPath, err)
}
return checkResultOK, filenameAbsPath.String()
fileInfo, err := system.Stat(filenameAbsPath)
if err != nil {
return checkResultError, fmt.Sprintf("%s: %v", filenameAbsPath, err)
}
message := fmt.Sprintf("%s, last modified %s", filenameAbsPath.String(), fileInfo.ModTime().Format(time.RFC3339))
return checkResultOK, message
default:
filenameStrs := make([]string, 0, len(filenameAbsPaths))
for filenameAbsPath := range filenameAbsPaths {
Expand Down

0 comments on commit 1af0576

Please sign in to comment.