diff --git a/scripts/arty.sh b/scripts/arty.sh index 594ab96a..233f8d51 100755 --- a/scripts/arty.sh +++ b/scripts/arty.sh @@ -282,20 +282,10 @@ parse_reference() { local config_file="$1" local ref_index="$2" - # Single yq call for all fields — multiple calls per reference were flooding - # the process table on hosts with low ulimit -u (e.g. IONOS shared hosting), - # causing intermittent empty 'into' values and wrong install locations. - yq eval " - .references[$ref_index] as \$r | - if (\$r | type) == \"!!str\" then - \$r + \"|||\" - else - ((\$r.url // \"\") | if . == \"null\" then \"\" else . end) + \"|\" + - ((\$r.into // \"\") | if . == \"null\" then \"\" else . end) + \"|\" + - ((\$r.ref // \"\") | if . == \"null\" then \"\" else . end) + \"|\" + - (\$r.env | if . == null then \"\" elif type == \"!!seq\" then join(\",\") else (. | if . == \"null\" then \"\" else . end) end) - end - " "$config_file" 2>/dev/null + # Single yq call using only // and select — if-then-else is not supported in + # all yq v4 builds. .url//. handles both string refs (no .url key) and object + # refs. env array is joined; null env falls back to empty string. + yq eval ".references[$ref_index] | (.url // .) + \"|\" + (.into // \"\") + \"|\" + (.ref // \"\") + \"|\" + ((.env | select(tag == \"!!seq\") | join(\",\")) // .env // \"\")" "$config_file" 2>/dev/null } # Check if current environment matches the filter