gh: add shell completions (#10524)

This commit is contained in:
Further 2022-05-07 07:49:50 +08:00 committed by GitHub
parent 211ef4d832
commit e70ca1281e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 0 deletions

View File

@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="GitHubs official command line tool"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="Krishna kanhaiya @kcubeterm"
TERMUX_PKG_VERSION="2.9.0"
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://github.com/cli/cli/archive/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=730b600d33afb67d84af4dca1af80cb1fbff79d302ac4f840fc8e9e4c25fceb7
TERMUX_PKG_AUTO_UPDATE=true
@ -29,3 +30,22 @@ termux_step_make_install() {
install -Dm700 -t "$TERMUX_PREFIX"/bin "$GOPATH"/src/github.com/cli/cli/cmd/gh/gh
install -Dm600 -t "$TERMUX_PREFIX"/share/doc/gh/ "$TERMUX_PKG_SRCDIR"/docs/*
}
termux_step_create_debscripts() {
cat <<-EOF >./postinst
#!${TERMUX_PREFIX}/bin/sh
mkdir -p ${TERMUX_PREFIX}/share/bash-completion/completions
mkdir -p ${TERMUX_PREFIX}/share/zsh/site-functions
mkdir -p ${TERMUX_PREFIX}/share/fish/vendor_completions.d
gh completion -s bash > ${TERMUX_PREFIX}/share/bash-completion/completions/gh.bash
gh completion -s zsh > ${TERMUX_PREFIX}/share/zsh/site-functions/_gh
gh completion -s fish > ${TERMUX_PREFIX}/share/fish/vendor_completions.d/gh.fish
EOF
cat <<-EOF >./prerm
#!${TERMUX_PREFIX}/bin/sh
rm -f ${TERMUX_PREFIX}/share/bash-completion/completions/gh.bash
rm -f ${TERMUX_PREFIX}/share/zsh/site-functions/_gh
rm -f ${TERMUX_PREFIX}/share/fish/vendor_completions.d/gh.fish
EOF
}