summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authornltimv2023-08-04 22:36:34 +0200
committernltimv2023-08-04 22:36:34 +0200
commitec4b796f4d861a4262401ae60e9a3ccfe0d9d069 (patch)
treede3192927ae1c38a2b916748a9845f1a3a723890
parentdb5ad6107d17c03b5e4b5d12004913829942f796 (diff)
downloadaur-ec4b796f4d861a4262401ae60e9a3ccfe0d9d069.tar.gz
Add shell completion
-rw-r--r--PKGBUILD14
1 files changed, 14 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
index d2b1c8d91caf..1face71ecda7 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -42,6 +42,20 @@ check() {
package() {
cd "$srcdir/weave-gitops"
+
+ # prevent the question about analytics from being shown during packaging
+ mkdir fake_config_dir
+ export XDG_CONFIG_HOME="$(pwd)/fake_config_dir"
+ echo '{"analytics": false}' > "$XDG_CONFIG_HOME/weave-gitops-config.json"
+
+ mkdir -p "$pkgdir/usr/share/bash-completion/completions"
+ mkdir -p "$pkgdir/usr/share/fish/vendor_completions.d"
+ mkdir -p "$pkgdir/usr/share/zsh/site-functions"
+
+ bin/gitops completion bash > "$pkgdir/usr/share/bash-completion/completions/gitops"
+ bin/gitops completion fish > "$pkgdir/usr/share/fish/vendor_completions.d/gitops.fish"
+ bin/gitops completion zsh > "$pkgdir/usr/share/zsh/site-functions/_gitops"
+
install -Dm 755 bin/gitops $pkgdir/usr/bin/gitops
install -Dm 755 bin/gitops-server $pkgdir/usr/bin/gitops-server