···1818 "errors"
1919 "os"
2020 "path/filepath"
2121+ "time"
21222223 log "github.com/Sirupsen/logrus"
2324)
···5253 Panic("Unable to check path")
5354 }
5455 return false
5656+}
5757+5858+// LastModified returns the time the file on the path was last modified,
5959+// if file lookup fails the current time is returned.
6060+func LastModified(path string) time.Time {
6161+ stat, err := os.Stat(path)
6262+ if err == nil {
6363+ return stat.LastModified
6464+ }
6565+ return time.Now()
5566}
56675768// FindFileDir returns the path of the
+4
settings/score.go
···1818 "encoding/json"
1919 "io/ioutil"
2020 "time"
2121+2222+ "github.com/jjdekker/ponder/helpers"
2123)
22242325// Score represents the settings for a specific score file
···4042 if err != nil {
4143 return nil, err
4244 }
4545+ s.LastModified = helpers.LastModified(s.Path)
4646+4347 return &s, nil
4448}