Skip to content

Instantly share code, notes, and snippets.

@tongpu
Last active June 12, 2018 09:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tongpu/2154f38edb1808f828590a43f8447806 to your computer and use it in GitHub Desktop.
Updated PKGBUILD for stern-bin to include bash and zsh completion
# Maintainer: Simon Weald <simon[at]simonweald[dot]com>
pkgname=stern-bin
pkgdesc="Multi pod and container log tailing for Kubernetes"
pkgver=1.6.0
pkgrel=2
arch=('x86_64')
url="https://github.com/wercker/stern"
license=('apache')
_stern_file=stern_linux_amd64
source=("https://github.com/wercker/stern/releases/download/$pkgver/$_stern_file")
sha256sums=('085325dcd7f3de20fb58ca964d5acf2b6c9d0f239800eb53a234363b0fd296b5')
package() {
install -Dm 755 "$srcdir/$_stern_file" "$pkgdir/usr/bin/stern"
install -d 755 "$pkgdir/usr/share/bash-completion/completions"
"$pkgdir/usr/bin/stern" --completion=bash > "$pkgdir/usr/share/bash-completion/completions/stern"
install -d 755 "$pkgdir/usr/share/zsh/site-functions"
"$pkgdir/usr/bin/stern" --completion=zsh > "$pkgdir/usr/share/zsh/site-functions/_stern"
}
diff --git a/PKGBUILD b/PKGBUILD
index 40844d7..e668d65 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
pkgname=stern-bin
pkgdesc="Multi pod and container log tailing for Kubernetes"
pkgver=1.6.0
-pkgrel=1
+pkgrel=2
arch=('x86_64')
url="https://github.com/wercker/stern"
license=('apache')
@@ -13,4 +13,9 @@ sha256sums=('085325dcd7f3de20fb58ca964d5acf2b6c9d0f239800eb53a234363b0fd296b5')
package() {
install -Dm 755 "$srcdir/$_stern_file" "$pkgdir/usr/bin/stern"
+ install -d 755 "$pkgdir/usr/share/bash-completion/completions"
+ "$pkgdir/usr/bin/stern" --completion=bash > "$pkgdir/usr/share/bash-completion/completions/stern"
+ install -d 755 "$pkgdir/usr/share/zsh/site-functions"
+ "$pkgdir/usr/bin/stern" --completion=zsh > "$pkgdir/usr/share/zsh/site-functions/_stern"
+
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment