diff options
author | Clement Tsang <34804052+ClementTsang@users.noreply.github.com> | 2020-08-31 17:50:21 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-31 17:50:21 -0400 |
commit | 34314112154a42f7c1d4d822f94e478b55dbe9b6 (patch) | |
tree | 3a063e7d28093ab01c1e3e1b2da3e7442b7b72c9 /deployment | |
parent | c6a20a14201c46441f82938adf6f3f4bbd7441a8 (diff) |
other: Add autocomplete file generation (#213)
Adds shell completion generation as part of the build, as well as tweaking install scripts/templates/CI to use them.
Diffstat (limited to 'deployment')
-rw-r--r-- | deployment/linux/arch/PKGBUILD.template | 5 | ||||
-rw-r--r-- | deployment/linux/arch/PKGBUILD_BIN.template | 16 | ||||
-rw-r--r-- | deployment/macos/homebrew/bottom.rb.template | 2 |
3 files changed, 17 insertions, 6 deletions
diff --git a/deployment/linux/arch/PKGBUILD.template b/deployment/linux/arch/PKGBUILD.template index 583209ae..e9311b43 100644 --- a/deployment/linux/arch/PKGBUILD.template +++ b/deployment/linux/arch/PKGBUILD.template @@ -26,4 +26,9 @@ package() { cd $pkgname-$pkgver install -Dm755 target/release/btm "$pkgdir/usr/bin/btm" install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/${pkgname}/LICENSE" + + local target_dir=$(ls target/release/build/bottom-*/out/rg.bash | head -n1 | xargs dirname) + install -Dm644 "$target_dir"/_btm "$pkgdir/usr/share/zsh/site-functions/_btm" + install -Dm644 "$target_dir"/btm.bash "$pkgdir/usr/share/bash-completion/completions/btm" + install -Dm644 "$target_dir"/btm.fish "$pkgdir/usr/share/fish/vendor_completions.d/btm.fish" }
\ No newline at end of file diff --git a/deployment/linux/arch/PKGBUILD_BIN.template b/deployment/linux/arch/PKGBUILD_BIN.template index e2003c95..9111363c 100644 --- a/deployment/linux/arch/PKGBUILD_BIN.template +++ b/deployment/linux/arch/PKGBUILD_BIN.template @@ -10,15 +10,19 @@ arch=('x86_64') url="https://github.com/ClementTsang/bottom" license=(MIT) source=( - archive-${pkgver}.tar.gz::${url}/releases/download/${pkgver}/bottom_x86_64-unknown-linux-gnu.tar.gz - LICENSE::${url}/raw/${pkgver}/LICENSE + archive-${pkgver}.tar.gz::${url}/releases/download/${pkgver}/bottom_x86_64-unknown-linux-gnu.tar.gz + LICENSE::${url}/raw/${pkgver}/LICENSE ) sha512sums=( - '$hash1' - SKIP + '$hash1' + SKIP ) package() { - install -Dm755 btm "$pkgdir"/usr/bin/btm - install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE + install -Dm755 btm "$pkgdir"/usr/bin/btm + install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE + + install -Dm644 completion/_btm "$pkgdir/usr/share/zsh/site-functions/_btm" + install -Dm644 completion/btm.bash "$pkgdir/usr/share/bash-completion/completions/btm" + install -Dm644 completion/btm.fish "$pkgdir/usr/share/fish/vendor_completions.d/btm.fish" } diff --git a/deployment/macos/homebrew/bottom.rb.template b/deployment/macos/homebrew/bottom.rb.template index 451905cf..1e9fce5b 100644 --- a/deployment/macos/homebrew/bottom.rb.template +++ b/deployment/macos/homebrew/bottom.rb.template @@ -11,6 +11,8 @@ class Bottom < Formula end def install + bash_completion.install "completion/rg.bash" + zsh_completion.install "completion/_rg" bin.install "btm" ohai "You're done! Run with \"btm\"" ohai "For runtime flags, see \"btm --help\"" |