mirror of
https://github.com/saymrwulf/anza-cryptography-source.git
synced 2026-09-04 20:24:04 +00:00
15 lines
322 B
Bash
15 lines
322 B
Bash
|
|
# 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
|
||
|
|
}
|