chg: Use the helper functions for bat

This commit is contained in:
Sayantan Santra 2023-09-12 16:57:10 -05:00
parent 6e4b13ea58
commit b4360dc624
Signed by: SinTan1729
GPG key ID: EB3E68BFBA25C85F

View file

@ -14,7 +14,7 @@ sources=()
checksums=() checksums=()
version() { version() {
printf "$(curl -sL "https://api.github.com/repos/${git_repo}/releases/latest" | jq -r '.tag_name')" printf "$(curl -sL "https://api.github.com/repos/${git_repo}/releases/latest" | jq -r '.tag_name')"
} }
package() { package() {
@ -26,12 +26,11 @@ package() {
tar -xzf "${name}.tar.gz" -C . tar -xzf "${name}.tar.gz" -C .
cd "./${name}-${version}-x86_64-unknown-linux-musl" cd "./${name}-${version}-x86_64-unknown-linux-musl"
# Binary # Binary
install -Dm755 "./${name}" "${pkgdir}/usr/bin/${name}" install-binary "./${name}"
# Manpage # Manpage
install -Dm644 "./${name}.1" "${pkgdir}/usr/share/man/man1/${name}.1" install-manual "./${name}.1"
# Autocomplete # Autocomplete
command -v fish &> /dev/null && install -Dm644 "./autocomplete/${name}.fish" "${pkgdir}/usr/share/fish/completions/${name}.fish" install-completion fish <"./autocomplete/${name}.fish"
command -v zsh &> /dev/null && install -Dm644 "./autocomplete/${name}.zsh" "${pkgdir}/usr/share/zsh/site-functions/_${name}" install-completion zsh "./autocomplete/${name}.zsh"
command -v bash &> /dev/null && install -Dm644 "./autocomplete/${name}.bash" "${pkgdir}/usr/share/bash-completion/completions/${name}" install-completion bash "./autocomplete/${name}.bash"
} }