bootstrap: simplify export_variables

Nameref attribute (local -n) is a Bash 4.3 feature, thus not available
on OSX with Bash 3.2.

And because we know the argument looks like a valid assignment, we can
pass it whole to export.
This commit is contained in:
Mickey Rose 2020-01-03 15:38:48 +01:00
parent d38d16ade9
commit 0bddff6977

View file

@ -139,8 +139,7 @@ function export_variables() {
do do
if [[ "$arg" =~ ^[[:alpha:]][_[:alnum:]]*= ]] if [[ "$arg" =~ ^[[:alpha:]][_[:alnum:]]*= ]]
then then
local -n var="${arg%%=*}" export "$arg"
export var="${arg#*=}"
else else
printf >&2 "bootstrap.sh: invalid argument: %s\n" "$arg" printf >&2 "bootstrap.sh: invalid argument: %s\n" "$arg"
ret=1 ret=1