From 7dcca85747be46cfb72363ba221fcfb4f29aa976 Mon Sep 17 00:00:00 2001 From: Gabriel Sanches Date: Mon, 21 Sep 2020 13:28:53 -0300 Subject: [PATCH] github-cli: install shell completion --- srcpkgs/github-cli/template | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/srcpkgs/github-cli/template b/srcpkgs/github-cli/template index d1446631aeb..06c23761f05 100644 --- a/srcpkgs/github-cli/template +++ b/srcpkgs/github-cli/template @@ -1,9 +1,10 @@ # Template file for 'github-cli' pkgname=github-cli version=1.0.0 -revision=1 +revision=2 wrksrc="cli-${version}" build_style=go +build_helper=qemu go_import_path="github.com/cli/cli/cmd/gh" go_ldflags="-X github.com/cli/cli/command.Version=v${version}" short_desc="GitHub CLI tool" @@ -22,6 +23,19 @@ pre_build() { fi } +post_build() { + gopath=$(go env GOPATH) + gh=$(find $gopath/bin -name gh) + for shell in bash fish zsh; do + vtargetrun $gh completion -s $shell > github-cli.$shell + done +} + post_install() { vlicense LICENSE + + # install shell completions + for shell in bash fish zsh; do + vcompletion github-cli.$shell $shell gh + done }