Skip to content

A library of Agent Skills designed to work with the Stitch MCP server. Each skill follows the Agent Skills open standard, for compatibility with coding agents such as Antigravity, Gemini CLI, Claude Code, Cursor.

TypeScript

fix(remotion): fail download script on HTTP errors

Emp15003c2ad579f582
diff --git a/plugins/stitch-build/skills/remotion/scripts/download-stitch-asset.sh b/plugins/stitch-build/skills/remotion/scripts/download-stitch-asset.sh
index 497d4e3..e3f513f 100755
--- a/plugins/stitch-build/skills/remotion/scripts/download-stitch-asset.sh
+++ b/plugins/stitch-build/skills/remotion/scripts/download-stitch-asset.sh
@@ -21,12 +21,11 @@ mkdir -p "$OUTPUT_DIR"
echo "Downloading from: $DOWNLOAD_URL"
echo "Saving to: $OUTPUT_PATH"
-# Use curl with follow redirects and authentication handling
-curl -L -o "$OUTPUT_PATH" "$DOWNLOAD_URL"
-
-if [ $? -eq 0 ]; then
+# Use curl with follow redirects; -f fails on HTTP errors so an error
+# response (e.g. an expired signed URL) is not saved as the asset
+if curl -L -f -o "$OUTPUT_PATH" "$DOWNLOAD_URL"; then
echo "✓ Successfully downloaded to $OUTPUT_PATH"
-
+
# Display file size for verification
if command -v stat &> /dev/null; then
FILE_SIZE=$(stat -f%z "$OUTPUT_PATH" 2>/dev/null || stat -c%s "$OUTPUT_PATH" 2>/dev/null)
@@ -34,5 +33,6 @@ if [ $? -eq 0 ]; then
fi
else
echo "✗ Download failed"
+ rm -f "$OUTPUT_PATH"
exit 1
fi