1 Star 0 Fork 0

iamRegina/govendor

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
sync.go 874 Bytes
一键复制 编辑 原始数据 按行查看 历史
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package run
import (
"flag"
"io"
"github.com/kardianos/govendor/context"
"github.com/kardianos/govendor/help"
)
func (r *runner) Sync(w io.Writer, subCmdArgs []string) (help.HelpMessage, error) {
flags := flag.NewFlagSet("sync", flag.ContinueOnError)
insecure := flags.Bool("insecure", false, "allow insecure network updates")
dryrun := flags.Bool("n", false, "dry run, print what would be done")
flags.SetOutput(nullWriter{})
err := flags.Parse(subCmdArgs)
if err != nil {
return help.MsgSync, err
}
ctx, err := r.NewContextWD(context.RootVendor)
if err != nil {
return help.MsgSync, err
}
ctx.Insecure = *insecure
if *dryrun {
ctx.Logger = w
}
return help.MsgNone, ctx.Sync(*dryrun)
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/iamReginaaaa/govendor.git
git@gitee.com:iamReginaaaa/govendor.git
iamReginaaaa
govendor
govendor
v1.0.5

搜索帮助