예제 #1
0
파일: list.go 프로젝트: pra85/antibody
package command

import (
	"fmt"

	"github.com/codegangsta/cli"
	"github.com/getantibody/antibody"
	"github.com/getantibody/antibody/bundle"
)

// List all downloaded bundles
var List = cli.Command{
	Name:  "list",
	Usage: "list all currently downloaded bundles",
	Action: func(ctx *cli.Context) {
		for _, b := range bundle.List(antibody.Home()) {
			fmt.Println(b.Name())
		}
	},
}
예제 #2
0
func TestList(t *testing.T) {
	home := internal.TempHome()
	defer os.RemoveAll(home)
	bundle.New("caarlos0/zsh-pg", home).Download()
	assert.NotEmpty(t, bundle.List(home))
}
예제 #3
0
파일: update.go 프로젝트: pra85/antibody
package command

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

// 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()
	},
}
예제 #4
0
func TestListEmptyFolder(t *testing.T) {
	home := internal.TempHome()
	defer os.RemoveAll(home)
	assert.Empty(t, bundle.List(home))
}