Skip to content
Snippets Groups Projects
Commit 14fb6cb3 authored by Orhun Parmaksız's avatar Orhun Parmaksız
Browse files

add shell completions (fixes FS#76606)

parent cb35d11d
No related branches found
Tags 2.13.2-2
No related merge requests found
......@@ -5,7 +5,7 @@
pkgname=onefetch
pkgver=2.13.2
pkgrel=1
pkgrel=2
pkgdesc="Git repository summary on your terminal"
url="https://github.com/o2sh/onefetch"
license=('MIT')
......@@ -19,12 +19,17 @@ sha256sums=('6a57e12fb049af89de13aeaf06f206be602e73872458ff4cd5725d3b82289123')
prepare() {
cd "$pkgname-$pkgver"
cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
mkdir -p completions
}
build() {
cd "$pkgname-$pkgver"
CFLAGS+=' -ffat-lto-objects'
cargo build --frozen --release --all-features
local _completion="target/release/$pkgname --generate"
$_completion bash > "completions/$pkgbase"
$_completion fish > "completions/$pkgbase.fish"
$_completion zsh > "completions/_$pkgbase"
}
check() {
......@@ -38,6 +43,9 @@ package() {
install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
install -Dm 644 LICENSE.md -t "$pkgdir/usr/share/licenses/$pkgname"
install -Dm 644 "docs/$pkgname.1" "$pkgdir/usr/share/man/man1/$pkgname.1"
install -Dm 664 "completions/$pkgname" -t "$pkgdir/usr/share/bash-completion/completions/"
install -Dm 664 "completions/$pkgname.fish" -t "$pkgdir/usr/share/fish/vendor_completions.d/"
install -Dm 664 "completions/_$pkgname" -t "$pkgdir/usr/share/zsh/site-functions/"
}
# vim: ts=2 sw=2 et:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment