Date: Sunday, May 14, 2023 @ 18:47:17
  Author: orhun
Revision: 1461681

upgpkg: cargo-shuttle 0.16.0-2: install shell completions

Modified:
  cargo-shuttle/trunk/PKGBUILD

----------+
 PKGBUILD |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2023-05-14 16:59:15 UTC (rev 1461680)
+++ PKGBUILD    2023-05-14 18:47:17 UTC (rev 1461681)
@@ -4,7 +4,7 @@
 pkgname=cargo-shuttle
 _commit=62a21c17d035fb62586ca2d0c786ccdca0d5d12c
 pkgver=0.16.0
-pkgrel=1
+pkgrel=2
 pkgdesc='Cargo command for the shuttle platform'
 arch=('x86_64')
 url="https://github.com/shuttle-hq/shuttle";
@@ -22,6 +22,7 @@
   git submodule init
   git config submodule."examples".url "${srcdir}/${pkgname}"-examples
   git -c protocol.file.allow=always submodule update --init --recursive
+  mkdir completions
 
   cd "$pkgname"
   cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
@@ -30,6 +31,11 @@
 build() {
   cd "$pkgname/$pkgname"
   cargo build --release --frozen
+  cd ..
+  local compgen="target/release/$pkgname generate -s"
+  $compgen bash >"completions/$pkgname"
+  $compgen fish >"completions/$pkgname.fish"
+  $compgen zsh >"completions/_$pkgname"
 }
 
 check() {
@@ -41,6 +47,9 @@
   cd "$pkgname"
   install -Dm 755 "target/release/$pkgname" -t "$pkgdir/usr/bin"
   install -Dm 644 "$pkgname/README.md" -t "$pkgdir/usr/share/doc/$pkgname"
+  install -Dm 644 "completions/$pkgname" -t 
"$pkgdir/usr/share/bash-completion/completions/"
+  install -Dm 644 "completions/$pkgname.fish" -t 
"$pkgdir/usr/share/fish/vendor_completions.d/"
+  install -Dm 644 "completions/_$pkgname" -t 
"$pkgdir/usr/share/zsh/site-functions/"
 }
 
 # vim:set ts=2 sw=2 et:

Reply via email to