File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,18 +37,20 @@ function waiting_process {
3737}
3838
3939function 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
You can’t perform that action at this time.
0 commit comments