Exemplo n.º 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()
	}
}
Exemplo n.º 2
0
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())
		}
	},
}
Exemplo n.º 3
0
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()
	},
}
Exemplo n.º 4
0
func TestDefaultHome(t *testing.T) {
	os.Unsetenv("ANTIBODY_HOME")
	assert.NotEmpty(t, antibody.Home())
}
Exemplo n.º 5
0
func TestCustomHome(t *testing.T) {
	home := internal.TempHome()
	defer os.RemoveAll(home)
	assert.Equal(t, home, antibody.Home())
}
Exemplo n.º 6
0
package command

import (
	"fmt"

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

// Home shows current antibody home folder
var Home = cli.Command{
	Name:    "home",
	Aliases: []string{"prefix", "p"},
	Usage:   "shows the current antibody home folder",
	Action: func(ctx *cli.Context) {
		fmt.Println(antibody.Home())
	},
}