From 363e126914b1f36d887d694b00ba3169439286eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Fri, 5 Jun 2026 23:18:24 +0200 Subject: [PATCH] fix: rewrite parse_reference without if-then-else (unsupported in yq v4) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous expression used `if ($r | type) == "!!str" then ... end` which produces a lexer error in yq v4.50–v4.53. This caused every parse_reference call to return empty output, silently skipping all references — the root cause of the missing [INFO] messages and tree. Replace with a single-line expression using only the // alternative operator and select(), which work across all tested yq v4 versions: .references[N] | (.url // .) + "|" + (.into // "") + "|" + (.ref // "") + "|" + ((.env | select(tag == "!!seq") | join(",")) // .env // "") .url // . handles both string refs (no .url key) and object refs. env arrays are joined; null env falls back to "". Co-Authored-By: Claude Sonnet 4.6 --- scripts/arty.sh | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) 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