From 52ec68799ccf43f77170585a9065021a54441478 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sun, 15 Mar 2020 20:43:13 -0400 Subject: [PATCH] ci: make script names consistent --- .github/workflows/ci.yml | 4 ++-- Cargo.toml | 2 +- ci/{build_deb.sh => build-deb} | 15 ++++----------- ci/{sha256.sh => sha256-releases} | 0 ci/{test_complete.sh => test-complete} | 0 complete/_rg | 4 ++-- 6 files changed, 9 insertions(+), 16 deletions(-) rename ci/{build_deb.sh => build-deb} (69%) rename ci/{sha256.sh => sha256-releases} (100%) rename ci/{test_complete.sh => test-complete} (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7cbd2285..afaac5c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -170,12 +170,12 @@ jobs: - name: Test zsh shell completions (Unix, sans cross) # We could test this when using Cross, but we'd have to execute the - # 'rg' binary (done in test_complete.sh) with qemu, which is a pain and + # 'rg' binary (done in test-complete) with qemu, which is a pain and # doesn't really gain us much. If shell completion works in one place, # it probably works everywhere. if: matrix.target == '' && matrix.os != 'windows-2019' shell: bash - run: ci/test_complete.sh + run: ci/test-complete rustfmt: name: rustfmt diff --git a/Cargo.toml b/Cargo.toml index 0fefcfab..f356229f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -98,7 +98,7 @@ assets = [ # The man page is automatically generated by ripgrep's build process, so # this file isn't actually commited. Instead, to create a dpkg, either # create a deployment/deb directory and copy the man page to it, or use the - # 'ci/build_deb.sh' script. + # 'ci/build-deb' script. ["deployment/deb/rg.1", "usr/share/man/man1/rg.1", "644"], # Similarly for shell completions. ["deployment/deb/rg.bash", "usr/share/bash-completion/completions/rg", "644"], diff --git a/ci/build_deb.sh b/ci/build-deb similarity index 69% rename from ci/build_deb.sh rename to ci/build-deb index 4812b47e..e16e8f05 100755 --- a/ci/build_deb.sh +++ b/ci/build-deb @@ -1,6 +1,7 @@ #!/bin/bash set -e +D="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" # This script builds a binary dpkg for Debian based distros. It does not # currently run in CI, and is instead run manually and the resulting dpkg is @@ -23,20 +24,12 @@ fi # the deb, which knows where to look. DEPLOY_DIR=deployment/deb +OUT_DIR="$("$D"/cargo-out-dir target/debug/)" 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" "$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/" +# Copy man page and shell completions. +cp "$OUT_DIR"/{rg.1,rg.bash,rg.fish,_rg} "$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. diff --git a/ci/sha256.sh b/ci/sha256-releases similarity index 100% rename from ci/sha256.sh rename to ci/sha256-releases diff --git a/ci/test_complete.sh b/ci/test-complete similarity index 100% rename from ci/test_complete.sh rename to ci/test-complete diff --git a/complete/_rg b/complete/_rg index a8462c81..828a6e60 100644 --- a/complete/_rg +++ b/complete/_rg @@ -3,7 +3,7 @@ ## # zsh completion function for ripgrep # -# Run ci/test_complete.sh after building to ensure that the options supported by +# Run ci/test-complete after building to ensure that the options supported by # this function stay in synch with the `rg` binary. # # For convenience, a completion reference guide is included at the bottom of @@ -323,7 +323,7 @@ _rg() { '(--type-list)*: :_files' ) - # This is used with test_complete.sh to verify that there are no options + # This is used with test-complete to verify that there are no options # listed in the help output that aren't also defined here [[ $_RG_COMPLETE_LIST_ARGS == (1|t*|y*) ]] && { print -rl - $args