File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 "os/exec"
88 "path/filepath"
99 "strings"
10+ "time"
1011
1112 "github.com/pushchain/push-validator-cli/internal/update"
1213 ui "github.com/pushchain/push-validator-cli/internal/ui"
@@ -59,6 +60,15 @@ Examples:
5960 latestVersion := strings .TrimPrefix (release .TagName , "v" )
6061 currentVersion := strings .TrimPrefix (Version , "v" )
6162
63+ // Save result to cache for dashboard/background check
64+ cfg := loadCfg ()
65+ updateAvailable := update .IsNewerVersion (Version , release .TagName )
66+ _ = update .SaveCache (cfg .HomeDir , & update.CacheEntry {
67+ CheckedAt : time .Now (),
68+ LatestVersion : latestVersion ,
69+ UpdateAvailable : updateAvailable ,
70+ })
71+
6272 // Check if update needed
6373 if ! force && ! update .IsNewerVersion (Version , release .TagName ) {
6474 p .Success (fmt .Sprintf ("Already up to date (v%s)" , currentVersion ))
You can’t perform that action at this time.
0 commit comments