Skip to content

Commit

Permalink
alarmcn/fnm: use a better way to install shell completions
Browse files Browse the repository at this point in the history
  • Loading branch information
Integral-Tech committed Dec 28, 2024
1 parent 0270e15 commit 660a6dd
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions alarmcn/fnm/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,13 @@ build() {

package() {
cd "${pkgname}-${pkgver}/"
install -Dm755 "target/release/${pkgname}" -t "${pkgdir}/usr/bin/"

install -d ${pkgdir}/usr/share/{bash-completion/completions,fish/vendor_completions.d,zsh/site-functions}
"${pkgdir}/usr/bin/${pkgname}" completions --shell bash >"${pkgdir}/usr/share/bash-completion/completions/${pkgname}"
"${pkgdir}/usr/bin/${pkgname}" completions --shell fish >"${pkgdir}/usr/share/fish/vendor_completions.d/${pkgname}.fish"
"${pkgdir}/usr/bin/${pkgname}" completions --shell zsh >"${pkgdir}/usr/share/zsh/site-functions/_${pkgname}"

install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}/"
install -d "${pkgdir}/usr/share/doc/${pkgname}/"
cp docs/* "${pkgdir}/usr/share/doc/${pkgname}/"

cd target/release
install -Dm755 "${pkgname}" -t "${pkgdir}/usr/bin/"
"./${pkgname}" completions --shell bash | install -Dm644 /dev/stdin "${pkgdir}/usr/share/bash-completion/completions/${pkgname}"
"./${pkgname}" completions --shell fish | install -Dm644 /dev/stdin "${pkgdir}/usr/share/fish/vendor_completions.d/${pkgname}.fish"
"./${pkgname}" completions --shell zsh | install -Dm644 /dev/stdin "${pkgdir}/usr/share/zsh/site-functions/_${pkgname}"
}

0 comments on commit 660a6dd

Please sign in to comment.