summaryrefslogtreecommitdiff
path: root/statistics.go
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-11-21 08:38:15 +0800
committerEltrac <hi@guhub.cn>2025-11-21 08:38:15 +0800
commit4528958c13a5047d1e9e30d266996c93175e3731 (patch)
tree627c8463bee98534075934c5c6f5cc3f33ae11d8 /statistics.go
parentc5b8d2b4ac75904dc2e47b3c019e7e5a6d9c55ff (diff)
fix: show recent activity only if there's a binary
Diffstat (limited to 'statistics.go')
-rw-r--r--statistics.go3
1 files changed, 3 insertions, 0 deletions
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