Skip to content

Commit 91e276e

Browse files
committed
chore(build): change build args format
1 parent 2946f5b commit 91e276e

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

rootfs/imagebuilder/build

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,20 @@ function waiting_process {
3737
}
3838

3939
function write_build_env {
40-
local envfile dryccfile command config items i
40+
local envfile dryccfile command config items i arraytype
4141
envfile=$1
4242
dryccfile=$2
43-
if [[ -z "$3" ]]; then
43+
arraytype=$(cat < "$dryccfile" | yq ".build" -o json | jq '.config|type=="array"')
44+
45+
if [[ -z "$3" || "$arraytype" == "true" ]]; then
4446
command=".build.config"
4547
else
4648
command=".build.config.${3}"
4749
fi
4850
if [[ -f "$dryccfile" ]]; then
4951
config=$(cat < "$dryccfile" | yq "$command" -o json)
5052
if [[ $config != null ]]; then
51-
mapfile -t items < <(echo "$config" | jq -c -r 'to_entries[] | (.key, .value)')
53+
mapfile -t items < <(echo "$config" | jq -c -r '.[] | (.name, .value)')
5254
for ((i=0; i<"${#items[@]}"; i=i+2)); do
5355
echo "${items[i]}=${items[i+1]}" >> "${envfile}"
5456
done

0 commit comments

Comments
 (0)