@@ -66,11 +66,14 @@ func CheckFoGoFlutterUpdate(goDirectoryPath string, currentTag string) {
66
66
}
67
67
lastUpdateTimeStamp := time .Unix (i , 0 )
68
68
69
- newCheck := now .Sub (lastUpdateTimeStamp ).Hours () > 48.0 ||
69
+ checkRate := 1.0
70
+
71
+ newCheck := now .Sub (lastUpdateTimeStamp ).Hours () > checkRate ||
70
72
(now .Sub (lastUpdateTimeStamp ).Minutes () < 1.0 && // keep the notice for X Minutes
71
73
now .Sub (lastUpdateTimeStamp ).Minutes () > 0.0 )
72
74
73
- if newCheck {
75
+ checkUpdateOptOut := os .Getenv ("HOVER_IGNORE_CHECK_NEW_RELEASE" )
76
+ if newCheck && checkUpdateOptOut != "true" {
74
77
fmt .Printf ("hover: Checking available release on Github\n " )
75
78
76
79
// fecth the last githubTag
@@ -86,7 +89,7 @@ func CheckFoGoFlutterUpdate(goDirectoryPath string, currentTag string) {
86
89
87
90
// update the timestamp
88
91
// don't spam people who don't have access to internet
89
- now := time .Now ().Add (48 * time .Hour )
92
+ now := time .Now ().Add (time . Duration ( checkRate ) * time .Hour )
90
93
nowString := strconv .FormatInt (now .Unix (), 10 )
91
94
92
95
err = ioutil .WriteFile (cachedGoFlutterCheckPath , []byte (nowString ), 0664 )
@@ -98,10 +101,10 @@ func CheckFoGoFlutterUpdate(goDirectoryPath string, currentTag string) {
98
101
}
99
102
if res .Outdated {
100
103
fmt .Printf ("hover: The core library 'go-flutter' has an update available. (%s -> %s)\n " , currentTag , res .Current )
101
- fmt .Printf (" To update 'go-flutter' run: $ hover upgrade\n " )
104
+ fmt .Printf (" To update 'go-flutter' in this project run: $ hover upgrade\n " )
102
105
}
103
106
104
- if now .Sub (lastUpdateTimeStamp ).Hours () > 48.0 {
107
+ if now .Sub (lastUpdateTimeStamp ).Hours () > checkRate {
105
108
// update the timestamp
106
109
err = ioutil .WriteFile (cachedGoFlutterCheckPath , []byte (nowString ), 0664 )
107
110
if err != nil {
0 commit comments