summaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2018-09-07 13:28:57 -0400
committerAndrew Gallant <jamslam@gmail.com>2018-09-07 14:00:22 -0400
commitb7a456ae83dc0d065fe6f3d1d489e6cf71ba70f8 (patch)
tree528d6160be4cab032ebb60445f985f6d977b1a11 /ci
parentd14f0b37d651b276fcd6a6938b0da918b17f3326 (diff)
deb: add completions
This commit adds Bash, zsh and fish completions to the Debian binary package. Fixes #1032
Diffstat (limited to 'ci')
-rwxr-xr-xci/build_deb.sh22
1 files changed, 17 insertions, 5 deletions
diff --git a/ci/build_deb.sh b/ci/build_deb.sh
index eb516191..4812b47e 100755
--- a/ci/build_deb.sh
+++ b/ci/build_deb.sh
@@ -18,14 +18,26 @@ fi
# 'cargo deb' does not seem to provide a way to specify an asset that is
# created at build time, such as ripgrep's man page. To work around this,
-# we force a debug build, copy out the man page produced from that build, put
-# it into a predictable location and then build the deb, which knows where to
-# look.
+# we force a debug build, copy out the man page (and shell completions)
+# produced from that build, put it into a predictable location and then build
+# the deb, which knows where to look.
-mkdir -p deployment
+DEPLOY_DIR=deployment/deb
+mkdir -p "$DEPLOY_DIR"
cargo build
+
+# Find and copy man page.
manpage="$(find ./target/debug -name rg.1 -print0 | xargs -0 ls -t | head -n1)"
-cp "$manpage" deployment/
+cp "$manpage" "$DEPLOY_DIR/"
+
+# Do the same for shell completions.
+compbash="$(find ./target/debug -name rg.bash -print0 | xargs -0 ls -t | head -n1)"
+cp "$compbash" "$DEPLOY_DIR/"
+compfish="$(find ./target/debug -name rg.fish -print0 | xargs -0 ls -t | head -n1)"
+cp "$compfish" "$DEPLOY_DIR/"
+compzsh="complete/_rg"
+cp "$compzsh" "$DEPLOY_DIR/"
+
# Since we're distributing the dpkg, we don't know whether the user will have
# PCRE2 installed, so just do a static build.
PCRE2_SYS_STATIC=1 cargo deb