Skip to content

Commit 3193bae

Browse files
committed
address PR comment
1 parent 67e7be9 commit 3193bae

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

cmd/build.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func build(projectName string, targetOS string, vmArguments []string) {
8181
engineCachePath = enginecache.ValidateOrUpdateEngine(targetOS)
8282
}
8383

84-
if !(buildOmitFlutterBundle || buildOmitEmbedder) {
84+
if !buildOmitFlutterBundle && !buildOmitEmbedder {
8585
err = os.RemoveAll(outputDirectoryPath)
8686
fmt.Printf("hover: Cleaning the build directory\n")
8787
if err != nil {
@@ -105,7 +105,8 @@ func build(projectName string, targetOS string, vmArguments []string) {
105105

106106
match := re.FindStringSubmatch(string(cmdCheckFlutterOut))
107107
if len(match) >= 2 {
108-
if match[1] == "master" {
108+
ignoreWarning := os.Getenv("HOVER_IGNORE_CHANNEL_WARNING")
109+
if match[1] != "beta" && ignoreWarning != "true" {
109110
fmt.Println("hover: ⚠ The go-flutter project tries to stay compatible with the beta channel of Flutter.")
110111
fmt.Println("hover: ⚠ It's advised to use the beta channel. ($ flutter channel beta)")
111112
}

internal/enginecache/version.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,14 @@ func CheckFoGoFlutterUpdate(goDirectoryPath string, currentTag string) {
6666
}
6767
lastUpdateTimeStamp := time.Unix(i, 0)
6868

69-
newCheck := now.Sub(lastUpdateTimeStamp).Hours() > 48.0 ||
69+
checkRate := 1.0
70+
71+
newCheck := now.Sub(lastUpdateTimeStamp).Hours() > checkRate ||
7072
(now.Sub(lastUpdateTimeStamp).Minutes() < 1.0 && // keep the notice for X Minutes
7173
now.Sub(lastUpdateTimeStamp).Minutes() > 0.0)
7274

73-
if newCheck {
75+
checkUpdateOptOut := os.Getenv("HOVER_IGNORE_CHECK_NEW_RELEASE")
76+
if newCheck && checkUpdateOptOut != "true" {
7477
fmt.Printf("hover: Checking available release on Github\n")
7578

7679
// fecth the last githubTag
@@ -86,7 +89,7 @@ func CheckFoGoFlutterUpdate(goDirectoryPath string, currentTag string) {
8689

8790
// update the timestamp
8891
// 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)
9093
nowString := strconv.FormatInt(now.Unix(), 10)
9194

9295
err = ioutil.WriteFile(cachedGoFlutterCheckPath, []byte(nowString), 0664)
@@ -98,10 +101,10 @@ func CheckFoGoFlutterUpdate(goDirectoryPath string, currentTag string) {
98101
}
99102
if res.Outdated {
100103
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")
102105
}
103106

104-
if now.Sub(lastUpdateTimeStamp).Hours() > 48.0 {
107+
if now.Sub(lastUpdateTimeStamp).Hours() > checkRate {
105108
// update the timestamp
106109
err = ioutil.WriteFile(cachedGoFlutterCheckPath, []byte(nowString), 0664)
107110
if err != nil {

0 commit comments

Comments
 (0)