From 9481ee79a8bd385bd1336c254d0fc70f61dc91e6 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 19 Oct 2020 23:57:11 +0000 Subject: [PATCH] Ignore more paths in increment-cargo-version.sh (#12996) (cherry picked from commit c1c69ecc344839deefd430583acd575031308b06) Co-authored-by: Trent Nelson --- scripts/increment-cargo-version.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/scripts/increment-cargo-version.sh b/scripts/increment-cargo-version.sh index c114c2adfc..c5eaf9f398 100755 --- a/scripts/increment-cargo-version.sh +++ b/scripts/increment-cargo-version.sh @@ -30,8 +30,20 @@ readCargoVariable() { echo "Unable to locate $variable in $Cargo_toml" 1>&2 } -# shellcheck disable=2207 -Cargo_tomls=($(find . -mindepth 2 -name Cargo.toml -not -path './web3.js/examples/*')) +ignores=( + .cache + .cargo + target + web3.js/examples +) + +not_paths=() +for ignore in "${ignores[@]}"; do + not_paths+=(-not -path "*/$ignore/*") +done + +# shellcheck disable=2207,SC2068 # Don't want a positional arg if `not-paths` is empty +Cargo_tomls=($(find . -mindepth 2 -name Cargo.toml ${not_paths[@]})) # shellcheck disable=2207 markdownFiles=($(find . -name "*.md"))