Fix up bash array handling (#3771)

This commit is contained in:
Michael Vines 2019-04-15 13:25:44 -07:00 committed by GitHub
parent d026ebb83a
commit 87aef92e71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -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