From 87aef92e71773d62ba7c478e4613956084d18e2c Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Mon, 15 Apr 2019 13:25:44 -0700 Subject: [PATCH] Fix up bash array handling (#3771) --- scripts/increment-cargo-version.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/increment-cargo-version.sh b/scripts/increment-cargo-version.sh index ea9a6c846..c922e9cb4 100755 --- a/scripts/increment-cargo-version.sh +++ b/scripts/increment-cargo-version.sh @@ -28,12 +28,12 @@ readCargoVariable() { echo "Unable to locate $variable in $Cargo_toml" 1>&2 } -# shellcheck disable=2044 # Disable 'For loops over find output are fragile...' -Cargo_tomls="$(find . -name Cargo.toml)" +# shellcheck disable=2207 +Cargo_tomls=($(find . -name Cargo.toml)) # Collect the name of all the internal crates crates=() -for Cargo_toml in $Cargo_tomls; do +for Cargo_toml in "${Cargo_tomls[@]}"; do crates+=("$(readCargoVariable name "$Cargo_toml")") done @@ -42,6 +42,7 @@ MAJOR=0 MINOR=0 PATCH=0 SPECIAL="" + semverParseInto "$(readCargoVariable version "${Cargo_tomls[0]}")" MAJOR MINOR PATCH SPECIAL [[ -n $MAJOR ]] || usage @@ -76,7 +77,7 @@ esac newVersion="$MAJOR.$MINOR.$PATCH$SPECIAL" # Update all the Cargo.toml files -for Cargo_toml in $Cargo_tomls; do +for Cargo_toml in "${Cargo_tomls[@]}"; do # Set new crate version ( set -x