Skip to content

Commit

Permalink
github-cli: install shell completion
Browse files Browse the repository at this point in the history
  • Loading branch information
gbrlsnchs committed Sep 21, 2020
1 parent e5bc70d commit 72f5d19
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion srcpkgs/github-cli/template
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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
}

0 comments on commit 72f5d19

Please sign in to comment.