#!/usr/bin/env bash

set -euo pipefail

rm -rf dist

webpack --mode production
cp public/index.html dist/
cp public/preview.jpeg dist/
mkdir -p dist/godot/blends/textures
cp public/godot/*.tscn dist/godot/
cp public/godot/blends/*.bin dist/godot/blends/
cp public/godot/blends/*.gltf dist/godot/blends/
cp screenshots/2024-02-15.jpeg dist/preview-2024-02-15.jpeg
rsync -ruv public/godot/blends/textures/ dist/godot/blends/textures/
rsync -ruv public/music/ dist/music/
rsync -ruv public/shaders/ dist/shaders/
rsync -ruv public/sounds/ dist/sounds/

BUCKET=s3://misscerulean.com-2
aws s3 sync dist "$BUCKET"
