# Template file for 'k3d'
pkgname=k3d
version=5.7.3
revision=2
build_style=go
build_helper=qemu
go_import_path="github.com/k3d-io/k3d/v5"
go_ldflags="-X ${go_import_path}/version.Version=v$version"
go_mod_mode=default
depends="docker"
short_desc="Creates containerized k3s clusters"
maintainer="Daniel Lewan <daniel@teddydd.me>"
license="MIT"
homepage="https://k3d.io/"
changelog="https://raw.githubusercontent.com/k3d-io/k3d/main/CHANGELOG.md"
distfiles="https://github.com/k3d-io/k3d/archive/v${version}.tar.gz"
checksum=871b46e3b2857c18372d5d5fd231a4a09f1693fc0350ab3cb2c6587751b12f41
_completions="bash zsh fish"

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

post_install() {
	for shell in $_completions
	do
		vcompletion "completion.$shell" "$shell"
	done
	vlicense LICENSE
}
