Skip to content

Commit

Permalink
schema script
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesWoolfenden committed Feb 4, 2025
1 parent 5a6bf5f commit 653377f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
Empty file modified src/schema/update.ps1
100644 → 100755
Empty file.
32 changes: 32 additions & 0 deletions src/schema/update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

# Set working directory
ROOT_DIR="$(pwd)"
SCHEMA_URL="https://schema.cloudformation.us-east-1.amazonaws.com/CloudformationSchema.zip"
FILEPATH="${ROOT_DIR}/CloudformationSchema.zip"

# Function to cleanup on exit
cleanup() {
rm -f "${FILEPATH}"
}

# Error handling
set -e
trap cleanup EXIT

# Remove existing JSON files
rm -f ./*.json

# Download schema
echo "Downloading schema..."
curl -L -o "${FILEPATH}" "${SCHEMA_URL}" || {
echo "Failed to download schema"
exit 1
}

# Extract zip file
echo "Extracting schema..."
unzip -o "${FILEPATH}" || {
echo "Failed to extract schema"
exit 1
}

0 comments on commit 653377f

Please sign in to comment.