#!/bin/bash # Build hyprcrd distribution ZIP set -e cd "$(dirname "$0")" VERSION=$(grep "APP_VERSION" config.php | grep -oP "'[^']+'" | tail -1 | tr -d "'" || echo "dev") DIST="hyprcrd-${VERSION}.zip" # Rebuild Tailwind if CLI exists if [ -x ./tailwindcss ]; then echo "Building Tailwind CSS..." ./tailwindcss --input public/css/tailwind.css --output public/css/tailwind.out.css --content "public/index.php,public/js/**/*.js" --minify fi echo "Creating ${DIST}..." zip -r "$DIST" \ config.php \ Dockerfile \ docker-entrypoint.sh \ README.md \ .htaccess \ .gitignore \ src/ \ public/ \ -x "public/uploads/*" \ -x "public/uploads/.gitkeep" \ -x "public/css/tailwind.css" # Add empty dirs with gitkeep mkdir -p /tmp/hyprcrd-dist/data mkdir -p /tmp/hyprcrd-dist/public/uploads touch /tmp/hyprcrd-dist/data/.gitkeep touch /tmp/hyprcrd-dist/public/uploads/.gitkeep cd /tmp/hyprcrd-dist zip -r "$OLDPWD/$DIST" data/.gitkeep public/uploads/.gitkeep cd "$OLDPWD" rm -rf /tmp/hyprcrd-dist echo "Done: ${DIST} ($(du -h "$DIST" | cut -f1))"