aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2018-06-06 01:59:20 +0700
committerShulhan <ms@kilabit.info>2018-06-06 01:59:20 +0700
commit0a2f40a801301a649d53afa9113a451bf9bdc1a6 (patch)
tree57b0a71ec1720c58fac64709008f35dadf2fb8a1
parent3b757c524306223043f6baa4a3b172d5358aaaec (diff)
downloadbeku-0a2f40a801301a649d53afa9113a451bf9bdc1a6.tar.xz
Add govendor as one of vendor build mode
-rw-r--r--buildcmd.go11
-rw-r--r--env.go3
-rw-r--r--package.go4
3 files changed, 14 insertions, 4 deletions
diff --git a/buildcmd.go b/buildcmd.go
index 445a743..3bfa9e4 100644
--- a/buildcmd.go
+++ b/buildcmd.go
@@ -9,14 +9,17 @@ type buildMode uint
const (
buildModeDep buildMode = 1 << iota
buildModeGdm
+ buildModeGovendor
)
const (
- buildFileDep = "Gopkg.toml"
- buildFileGdm = "Godeps"
+ buildFileDep = "Gopkg.toml"
+ buildFileGdm = "Godeps"
+ buildFileGovendor = "vendor/vendor.json"
)
var (
- buildCmdDep = []string{"dep", "ensure"}
- buildCmdGdm = []string{"gdm", "restore"}
+ buildCmdDep = []string{"dep", "ensure"}
+ buildCmdGdm = []string{"gdm", "restore"}
+ buildCmdGovendor = []string{"govendor", "sync"}
)
diff --git a/env.go b/env.go
index 6e989ab..7d24054 100644
--- a/env.go
+++ b/env.go
@@ -1368,7 +1368,10 @@ func (env *Env) build(pkg *Package) (err error) {
buildCmdGdm = append(buildCmdGdm, "-v")
}
err = pkg.Run(env, buildCmdGdm)
+ } else if cmd&buildModeGovendor > 0 {
+ err = pkg.Run(env, buildCmdGovendor)
}
+
if err != nil {
fmt.Fprintf(defStderr, "[ENV] build %s >>> %s\n",
pkg.ImportPath, err.Error())
diff --git a/package.go b/package.go
index f22326e..db20264 100644
--- a/package.go
+++ b/package.go
@@ -322,6 +322,10 @@ func (pkg *Package) ScanBuild() (cmd buildMode) {
cmd |= buildModeGdm
return
}
+ ok = IsFileExist(pkg.FullPath, buildFileGovendor)
+ if ok {
+ cmd |= buildModeGovendor
+ }
return
}