# Template file for 'circleci-cli'
pkgname=circleci-cli
version=1.0.47876
revision=1
build_style=go
build_helper=qemu
go_import_path=github.com/CircleCI-Public/${pkgname}
go_package="${go_import_path}/cmd/circleci"
go_ldflags="-X github.com/CircleCI-Public/${pkgname}/version.Version=${version}
 -X github.com/CircleCI-Public/${pkgname}/version.packageManager=xbps"
short_desc="Use CircleCI from the command line"
maintainer="Orphaned <orphan@voidlinux.org>"
license="MIT"
homepage="https://circleci-public.github.io/circleci-cli/"
distfiles="https://github.com/CircleCI-Public/${pkgname}/archive/v${version}.tar.gz"
checksum=9888490d947b58369c62e4b9ba486b66e6338c3acbd39754c8be42591a81121b
_completions="bash zsh"

post_build() {
	cli=$(find $GOPATH/bin -name circleci)
	for shell in $_completions; do
		vtargetrun $cli completion $shell > ${pkgname}.${shell}
	done
}

pre_check() {
	# acceptance tests require pre-existing substrate
	make_check_target=$(go list ./... | grep -v '/acceptance$')
}

post_install() {
	vlicense LICENSE

	for shell in $_completions; do
		vcompletion ${pkgname}.${shell} $shell circleci
	done
}
