Skip to content

Commit

Permalink
setup for fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
Edwardius committed May 28, 2024
1 parent 3817049 commit 131719f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts/generate-fixtures.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ to_pascale_case() {
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"

echo "Preparing workspace..."
# Clean up any previous fixtures
git worktree remove "$PROJECT_DIR/build/data" 2>/dev/null || true
rm -rf "$PROJECT_DIR/build/data"
rm -rf "$PROJECT_DIR/build/fixtures"

# Create the fixture directory
mkdir -p "$PROJECT_DIR/build/fixtures"

echo "Processing images..."
# Convert AVIF images to WebP and JPEG for browsers that don't support AVIF
"$PROJECT_DIR"/node_modules/.bin/sharp --format webp --input "$PROJECT_DIR"'/public/assets/*.avif' --output "$PROJECT_DIR"'/public/assets/{name}.generated.webp'
Expand Down

0 comments on commit 131719f

Please sign in to comment.