diff options
| -rw-r--r-- | print.go | 13 | ||||
| -rw-r--r-- | statistics.go | 3 |
2 files changed, 11 insertions, 5 deletions
@@ -39,7 +39,8 @@ func printUserInteractionSummary(data *statistics) { data.ReverseDependencies) printed2 := printRecentActivity( data.InstalledVersion, - data.LastAccessTime) + data.LastAccessTime, + data.BinaryExists) if printed1 || printed2 { fmt.Println() } @@ -98,10 +99,12 @@ func printInstallDesc( // answers questions like "have I used this recently?" func printRecentActivity( - installedVersion string, - atime time.Time) (printed bool) { - // skip if not installed - if installedVersion == "" { + installed string, + atime time.Time, + binary bool) (printed bool) { + + // skip if not installed or no related binary + if installed == "" || !binary { return false } diff --git a/statistics.go b/statistics.go index c83a25f..80017c9 100644 --- a/statistics.go +++ b/statistics.go @@ -15,6 +15,7 @@ type statistics struct { InstalledAsDependency bool; InstalledOnRequest bool; + BinaryExists bool; LastAccessTime time.Time; InstalledVersion string; @@ -63,8 +64,10 @@ func UnifyInfo(formula *FormulaInfo, cask *CaskInfo, pkgName string) (*statistic info, err := os.Stat(binPath) if err != nil { atime = time.Time{} // skip if no binary is found + statObject.BinaryExists = false } else { atime = time.Unix(info.Sys().(*syscall.Stat_t).Atimespec.Unix()) + statObject.BinaryExists = true } statObject.LastAccessTime = atime |
