本文整理汇总了Golang中github.com/vube/depman/util.RunCommand函数的典型用法代码示例。如果您正苦于以下问题:Golang RunCommand函数的具体用法?Golang RunCommand怎么用?Golang RunCommand使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RunCommand函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: Clone
// Clone clones d.Repo into d.Path() if d.Path does not exist, otherwise it will cd to d.Path() and run git fetch
func (g *Git) Clone(d *Dependency) (err error) {
if !util.Exists(d.Path()) {
if d.Type == TypeGitClone {
err = util.RunCommand("git clone " + d.Repo + " " + d.Path())
} else {
err = util.RunCommand("go get -u " + d.Repo)
}
}
return
}
开发者ID:nicholascapo,项目名称:depman,代码行数:11,代码来源:git.go
示例2: Checkout
// Checkout uses the appropriate VCS to checkout the specified version of the code
func (g *Git) Checkout(d *Dependency) (err error) {
err = util.RunCommand("git checkout " + d.Version)
if err != nil {
err = g.Fetch(d)
if err == nil {
err = util.RunCommand("git checkout " + d.Version)
}
}
return
}
开发者ID:nicholascapo,项目名称:depman,代码行数:11,代码来源:git.go
示例3: Self
// Self upgrades this version of depman to the latest on the master branch
func Self() {
deps := dep.New()
d := new(dep.Dependency)
d.Repo = "github.com/vube/depman"
d.Version = "master"
d.Type = "git"
d.SetupVCS("depman")
deps.Map["depman"] = d
install.Recurse = false
install.Install(deps)
install.Recurse = true
util.RunCommand("go install github.com/vube/depman")
}
开发者ID:pombredanne,项目名称:depman,代码行数:16,代码来源:upgrade.go
示例4: Self
// Self upgrades this version of depman to the latest on the master branch
func Self(version string) {
selfCalled = true
util.Print(colors.Blue("Upgrading depman..."))
util.RunCommand("go get -u github.com/vube/depman")
cmd := exec.Command("depman", "--version")
out, err := cmd.CombinedOutput()
if err != nil {
result.RegisterError()
util.Print(colors.Red(string(out)))
return
}
newVersion := strings.TrimSuffix(strings.TrimPrefix(string(out), "Depman Version "), "\n")
if newVersion != version {
util.Print("Upgraded to Version " + newVersion)
} else {
util.Print("No upgrade found")
}
}
开发者ID:nicholascapo,项目名称:depman,代码行数:22,代码来源:upgrade.go
示例5: Clean
// Clean cleans a git repo: `git reset --hard HEAD ; git clean -fd`
func (g *Git) Clean(d *Dependency) {
util.PrintIndent(colors.Red("Cleaning:") + colors.Blue(" git reset --hard HEAD"))
util.RunCommand("git reset --hard HEAD")
util.RunCommand("git clean -fd")
return
}
开发者ID:nicholascapo,项目名称:depman,代码行数:7,代码来源:git.go
示例6: Fetch
// Fetch fetches a git repo
func (g *Git) Fetch(d *Dependency) (err error) {
err = util.RunCommand("git fetch origin")
return
}
开发者ID:nicholascapo,项目名称:depman,代码行数:5,代码来源:git.go
示例7: Update
// Update updates a git repo
func (g *Git) Update(d *Dependency) (err error) {
if g.isBranch(d.Version) {
err = util.RunCommand("git pull")
}
return
}
开发者ID:nicholascapo,项目名称:depman,代码行数:7,代码来源:git.go
示例8: Checkout
// Checkout updates a bzr repo
func (b *Bzr) Checkout(d *Dependency) (err error) {
err = util.RunCommand("bzr up --revision " + d.Version)
return
}
开发者ID:nicholascapo,项目名称:depman,代码行数:5,代码来源:bzr.go
示例9: Fetch
// Fetch pulls in a bzr repo
func (b *Bzr) Fetch(d *Dependency) (err error) {
err = util.RunCommand("bzr pull")
return
}
开发者ID:nicholascapo,项目名称:depman,代码行数:5,代码来源:bzr.go
示例10: Clone
// Clone clones a bzr repo
func (b *Bzr) Clone(d *Dependency) (err error) {
if !util.Exists(d.Path()) {
err = util.RunCommand("go get -u " + d.Repo)
}
return
}
开发者ID:nicholascapo,项目名称:depman,代码行数:7,代码来源:bzr.go
示例11: Clean
func (h *Hg) Clean(d *Dependency) {
util.PrintIndent(colors.Red("Cleaning:") + colors.Blue(" hg up --clean "+d.Version))
util.RunCommand("hg up --clean " + d.Version)
return
}
开发者ID:pombredanne,项目名称:depman,代码行数:5,代码来源:hg.go
示例12: Checkout
func (h *Hg) Checkout(d *Dependency) (err error) {
err = util.RunCommand("hg up " + d.Version)
return
}
开发者ID:pombredanne,项目名称:depman,代码行数:4,代码来源:hg.go
示例13: Fetch
func (h *Hg) Fetch(d *Dependency) (err error) {
err = util.RunCommand("hg pull")
return
}
开发者ID:pombredanne,项目名称:depman,代码行数:4,代码来源:hg.go
注:本文中的github.com/vube/depman/util.RunCommand函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论