Fix up bash array handling (#3771)
This commit is contained in:
parent
d026ebb83a
commit
87aef92e71
|
@ -28,12 +28,12 @@ readCargoVariable() {
|
||||||
echo "Unable to locate $variable in $Cargo_toml" 1>&2
|
echo "Unable to locate $variable in $Cargo_toml" 1>&2
|
||||||
}
|
}
|
||||||
|
|
||||||
# shellcheck disable=2044 # Disable 'For loops over find output are fragile...'
|
# shellcheck disable=2207
|
||||||
Cargo_tomls="$(find . -name Cargo.toml)"
|
Cargo_tomls=($(find . -name Cargo.toml))
|
||||||
|
|
||||||
# Collect the name of all the internal crates
|
# Collect the name of all the internal crates
|
||||||
crates=()
|
crates=()
|
||||||
for Cargo_toml in $Cargo_tomls; do
|
for Cargo_toml in "${Cargo_tomls[@]}"; do
|
||||||
crates+=("$(readCargoVariable name "$Cargo_toml")")
|
crates+=("$(readCargoVariable name "$Cargo_toml")")
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -42,6 +42,7 @@ MAJOR=0
|
||||||
MINOR=0
|
MINOR=0
|
||||||
PATCH=0
|
PATCH=0
|
||||||
SPECIAL=""
|
SPECIAL=""
|
||||||
|
|
||||||
semverParseInto "$(readCargoVariable version "${Cargo_tomls[0]}")" MAJOR MINOR PATCH SPECIAL
|
semverParseInto "$(readCargoVariable version "${Cargo_tomls[0]}")" MAJOR MINOR PATCH SPECIAL
|
||||||
[[ -n $MAJOR ]] || usage
|
[[ -n $MAJOR ]] || usage
|
||||||
|
|
||||||
|
@ -76,7 +77,7 @@ esac
|
||||||
newVersion="$MAJOR.$MINOR.$PATCH$SPECIAL"
|
newVersion="$MAJOR.$MINOR.$PATCH$SPECIAL"
|
||||||
|
|
||||||
# Update all the Cargo.toml files
|
# 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 new crate version
|
||||||
(
|
(
|
||||||
set -x
|
set -x
|
||||||
|
|
Loading…
Reference in New Issue