Skip to content

fix: go 1.13 avoid go PROXY. #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ func build(projectName string, targetOS string, vmArguments []string) {
}

if semver.Prerelease() != "" {
log.Infof("Upgrade 'go-flutter' to the latest release")
log.Infof("Upgrading 'go-flutter' to the latest release")
// no buildBranch provided and currentTag isn't a release,
// force update. (same behaviour as previous version of hover).
err = upgradeGoFlutter(targetOS, engineCachePath)
Expand All @@ -399,7 +399,7 @@ func build(projectName string, targetOS string, vmArguments []string) {
} else {
// when the buildBranch is empty and the currentTag is a release.
// Check if the 'go-flutter' needs updates.
versioncheck.CheckFoGoFlutterUpdate(filepath.Join(wd, buildPath), currentTag)
versioncheck.CheckForGoFlutterUpdate(filepath.Join(wd, buildPath), currentTag)
}

} else {
Expand Down
11 changes: 6 additions & 5 deletions cmd/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,14 @@ func upgradeGoFlutter(targetOS string, engineCachePath string) (err error) {
return
}

if buildBranch == "" {
buildBranch = "@latest"
}

cmdGoGetU := exec.Command(goBin, "get", "-u", "github.com/go-flutter-desktop/go-flutter"+buildBranch)
cmdGoGetU.Dir = filepath.Join(wd, buildPath)
cmdGoGetU.Env = append(os.Environ(),
"GOPROXY=direct", // github.com/golang/go/issues/32955 (allows '/' in branch name)
"GO111MODULE=on",
"CGO_LDFLAGS="+cgoLdflags,
)
Expand All @@ -75,11 +80,7 @@ func upgradeGoFlutter(targetOS string, engineCachePath string) (err error) {

err = cmdGoGetU.Run()
if err != nil {
versionName := buildBranch
if versionName == "" {
versionName = "latest"
}
log.Errorf("Updating go-flutter to %s version failed: %v", versionName, err)
log.Errorf("Updating go-flutter to %s version failed: %v", buildBranch, err)
return
}

Expand Down
4 changes: 2 additions & 2 deletions internal/versioncheck/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import (
"github.com/tcnksm/go-latest"
)

// CheckFoGoFlutterUpdate check the last 'go-flutter' timestamp we have cached
// CheckForGoFlutterUpdate check the last 'go-flutter' timestamp we have cached
// for the current project. If the last update comes back to more than X days,
// fetch the last Github release semver. If the Github semver is more recent
// than the current one, display the update notice.
func CheckFoGoFlutterUpdate(goDirectoryPath string, currentTag string) {
func CheckForGoFlutterUpdate(goDirectoryPath string, currentTag string) {
cachedGoFlutterCheckPath := filepath.Join(goDirectoryPath, ".last_goflutter_check")
cachedGoFlutterCheckBytes, err := ioutil.ReadFile(cachedGoFlutterCheckPath)
if err != nil && !os.IsNotExist(err) {
Expand Down