File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -18,14 +18,23 @@ jq -n \
1818 > request.json
1919
2020# Call Claude API
21+ echo " Calling Claude API..."
2122curl -s https://api.anthropic.com/v1/messages \
2223 -H " content-type: application/json" \
2324 -H " x-api-key: $ANTHROPIC_API_KEY " \
2425 -H " anthropic-version: 2023-06-01" \
2526 -d @request.json > response.json
2627
28+ # Check for API errors
29+ if jq -e ' .error' response.json > /dev/null 2>&1 ; then
30+ echo " API Error:"
31+ jq ' .error' response.json
32+ exit 1
33+ fi
34+
2735# Extract HTML
28- jq -r ' .content[0].text' response.json > docs/index.html.new
36+ echo " Extracting generated HTML..."
37+ jq -r ' .content[0].text // empty' response.json > docs/index.html.new
2938
3039# Verify output
3140if [ ! -s docs/index.html.new ]; then
You can’t perform that action at this time.
0 commit comments