init.sh: clean up setvars

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2025-04-26 22:09:14 +01:00
parent 9ec7215340
commit e009f09e7f
+4 -2
View File
@@ -20,10 +20,12 @@ setvars()
{
_setvars=""
if [ $# -lt 2 ]; then
printf "\$err \"setvars: too few args\""
printf "\$err \"setvars: too few args\\n\""
return 0
fi
val="$1" && shift 1 && for var in "$@"; do
val="$1"
shift 1
for var in "$@"; do
_setvars="$var=\"$val\"; $_setvars"
done
printf "%s\n" "${_setvars% }"