Пример #1
0
func doBundle(ctx *cli.Context) {
	if readFromStdin() {
		entries, _ := ioutil.ReadAll(os.Stdin)
		antibody.New(
			bundle.Parse(string(entries), antibody.Home()),
		).Download()
	} else {
		antibody.New(
			[]bundle.Bundle{bundle.New(ctx.Args().First(), antibody.Home())},
		).Download()
	}
}
Пример #2
0
func TestBundleAndUpdate(t *testing.T) {
	home := internal.TempHome()
	defer os.RemoveAll(home)
	a := antibody.New([]bundle.Bundle{
		bundle.New("caarlos0/zsh-pg", home),
		bundle.New("caarlos0/zsh-open-pr", home),
	})
	a.Download()
	a.Update()
	internal.AssertFileCount(t, 2, home)
}
Пример #3
0
package command

import (
	"github.com/akatrevorjay/antibody"
	"github.com/akatrevorjay/antibody/bundle"
	"github.com/codegangsta/cli"
)

// Update all previously bundled bundles
var Update = cli.Command{
	Name:  "update",
	Usage: "updates all previously bundled commands",
	Action: func(ctx *cli.Context) {
		antibody.New(bundle.List(antibody.Home())).Update()
	},
}