コード例 #1
0
ファイル: bundle.go プロジェクト: pra85/antibody
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
ファイル: bundle_test.go プロジェクト: pra85/antibody
func TestParseWithEmptyLines(t *testing.T) {
	home := internal.TempHome()
	defer os.RemoveAll(home)
	s := "caarlos0/zsh-pg\n\n  \ncaarlos0/zsh-open-pr"
	assert.Len(t, bundle.Parse(s, home), 2)
}