Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-08-25 18:58:04 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-08-25 21:50:58 +0300
commit45c9c45d1d0d99443fa6bb524a1265fa9ba95e0e (patch)
treec92be61768be071fe08cc0a26989bdf4314e59e5 /magefile.go
parentfce32c07fb80e9929bc2660cf1e681e93009d24b (diff)
Use Go 1.11 modules with Mage
See #5115
Diffstat (limited to 'magefile.go')
-rw-r--r--magefile.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/magefile.go b/magefile.go
index e8a9a7b5f..ecc4b0b58 100644
--- a/magefile.go
+++ b/magefile.go
@@ -32,14 +32,26 @@ func init() {
if exe := os.Getenv("GOEXE"); exe != "" {
goexe = exe
}
+
+ // We want to use Go 1.11 modules even if the source lives inside GOPATH.
+ // The default is "auto".
+ os.Setenv("GO111MODULE", "on")
}
func getDep() error {
+ if !isWindows() {
+ // We only need this on Appveyor.
+ // TODO(bep) go11 clean up the vendor stuff once Appveyor gets Go 1.11.
+ return nil
+ }
return sh.Run(goexe, "get", "-u", "github.com/golang/dep/cmd/dep")
}
// Install Go Dep and sync Hugo's vendored dependencies
func Vendor() error {
+ if !isWindows() {
+ return nil
+ }
mg.Deps(getDep)
return sh.Run("dep", "ensure")
}
@@ -268,6 +280,10 @@ func isGoLatest() bool {
return strings.Contains(runtime.Version(), "1.11")
}
+func isWindows() bool {
+ return runtime.GOOS == "windows"
+}
+
func buildTags() string {
// To build the extended Hugo SCSS/SASS enabled version, build with
// HUGO_BUILD_TAGS=extended mage install etc.