# Template file for 'cheat'
pkgname=cheat
version=5.1.0
revision=1
build_style=go
build_helper="qemu"
go_import_path="github.com/cheat/cheat"
go_package="./cmd/cheat"
short_desc="Create and view interactive cheatsheets on the command-line"
maintainer="Orphaned <orphan@voidlinux.org>"
license="MIT"
homepage="https://github.com/cheat/cheat"
distfiles="https://github.com/cheat/cheat/archive/refs/tags/${version}.tar.gz"
checksum=5ef8864dacb5b37268d7d26cd01f74b99a33b2e5eb5b290e4221358410c99db4

pre_check() {
	export EDITOR=ed
	export PAGER=cat
	export PATH="/usr/libexec/chroot-git:$PATH"
}

post_install() {
	for shell in bash fish zsh; do
		vtargetrun "${DESTDIR}/usr/bin/cheat" --completion bash >"cheat.${shell}"
		vcompletion "cheat.${shell}" "${shell}"
	done
	vman doc/cheat.1
	vlicense LICENSE.txt
}
