Skip to content

Commit a73b9c3

Browse files
daresteCopilot
andauthored
Update .github/scripts/verify-manifest.sh
Co-authored-by: Copilot <[email protected]>
1 parent f3b256c commit a73b9c3

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

.github/scripts/verify-manifest.sh

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,23 +61,8 @@ required=(
6161

6262
missing=()
6363
for p in "${required[@]}"; do
64-
# split dot-separated path into array elements and build a jq array literal
65-
IFS='.' read -r -a parts <<< "$p"
66-
# build JSON array like ["a","b"]
67-
jq_array="["
68-
first=1
69-
for part in "${parts[@]}"; do
70-
if [[ $first -eq 1 ]]; then
71-
jq_array+="\"${part}\""
72-
first=0
73-
else
74-
jq_array+=",\"${part}\""
75-
fi
76-
done
77-
jq_array+="]"
78-
79-
# Test presence: use getpath(array) and check that it exists and is not null
80-
if ! jq -e "getpath($jq_array) != null" "$manifest" >/dev/null 2>&1; then
64+
# Test presence: use getpath(split(".")) and check that it exists and is not null
65+
if ! jq -e --arg p "$p" 'getpath($p | split(".")) != null' "$manifest" >/dev/null 2>&1; then
8166
missing+=("$p")
8267
fi
8368
done

0 commit comments

Comments
 (0)