Add downstream project build testing
This commit is contained in:
14
scripts/read-cargo-variable.sh
Normal file
14
scripts/read-cargo-variable.sh
Normal file
@ -0,0 +1,14 @@
|
||||
# source this file
|
||||
|
||||
readCargoVariable() {
|
||||
declare variable="$1"
|
||||
declare Cargo_toml="$2"
|
||||
|
||||
while read -r name equals value _; do
|
||||
if [[ $name = "$variable" && $equals = = ]]; then
|
||||
echo "${value//\"/}"
|
||||
return
|
||||
fi
|
||||
done < <(cat "$Cargo_toml")
|
||||
echo "Unable to locate $variable in $Cargo_toml" 1>&2
|
||||
}
|
Reference in New Issue
Block a user