Skip to content

Commit b312ce3

Browse files
fix: cloudflare purge
1 parent d8352c3 commit b312ce3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/cdn-cf.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ for FILE in "${FILES}"/*; do
3737
done
3838

3939
# Create JSON payload for Cloudflare API
40-
PURGE_JSON=$(printf '{"files":["%s"]}' "$(IFS='","'; echo "${PURGE_URLS[*]}")")
40+
PURGE_JSON=$(jq -n --argjson urls "$(printf '%s\n' "${PURGE_URLS[@]}" | jq -R . | jq -s .)" '{files: $urls}')
4141

4242
echo "Purging cache via Cloudflare API"
4343
echo "JSON payload: $PURGE_JSON"

0 commit comments

Comments
 (0)