Something went wrong. Try again.
Monorepo for Aesthetic.Computer aesthetic.computer
Something went wrong. Try again.
2.4 kB · 72 lines
Shell
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273#!/bin/bash# Update builds.false.work/index.html with new build linkset -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"VAULT_DIR="$SCRIPT_DIR/../../../aesthetic-computer-vault/false.work"INDEX_SOURCE="$SCRIPT_DIR/../../false.work/builds.false.work/index.html"INDEX_PUBLIC="$SCRIPT_DIR/../../system/public/builds.false.work/index.html"
PLATFORM=${1:-mac}VERSION=${2:-$(date +%Y.%m.%d.%H.%M)}
# Load Spaces configif [ -f "$VAULT_DIR/builds-spaces.env" ]; then source "$VAULT_DIR/builds-spaces.env"else echo "❌ ERROR: builds-spaces.env not found" exit 1fi
ARCHIVE="spiderlily-${PLATFORM}-${VERSION}.tar.gz"CDN_URL="https://$BUILDS_SPACES_BUCKET.$BUILDS_SPACES_REGION.cdn.digitaloceanspaces.com/$PLATFORM/$ARCHIVE"LATEST_URL="https://$BUILDS_SPACES_BUCKET.$BUILDS_SPACES_REGION.cdn.digitaloceanspaces.com/$PLATFORM/spiderlily-${PLATFORM}-latest.tar.gz"
# Read current indexif [ ! -f "$INDEX_SOURCE" ]; then echo "❌ ERROR: Index not found at $INDEX_SOURCE" exit 1fi
# Create new build entryBUILD_ENTRY=" <li><a href=\"$CDN_URL\">SpiderLily $PLATFORM $VERSION</a> - $(date '+%B %d, %Y %H:%M')</li>"
# Find the insertion point (after the builds list comment or header)# Insert after "Latest Builds" section or create itif grep -q "<!-- BUILD_LIST_$PLATFORM -->" "$INDEX_SOURCE"; then # Insert after the comment sed -i.bak "/<!-- BUILD_LIST_$PLATFORM -->/a\\$BUILD_ENTRY" "$INDEX_SOURCE"else # Add section if it doesn't exist SECTION=" <h2>$PLATFORM Builds</h2> <ul> <!-- BUILD_LIST_$PLATFORM -->$BUILD_ENTRY </ul>" # Insert before closing body tag sed -i.bak "/<\/body>/i\\$SECTION" "$INDEX_SOURCE"fi
# Update "latest" link if existsif grep -q "Latest $PLATFORM Build" "$INDEX_SOURCE"; then sed -i.bak "s|Latest $PLATFORM Build.*</a>|Latest $PLATFORM Build</a> - <a href=\"$LATEST_URL\">Download</a>|" "$INDEX_SOURCE"fi
# Copy to public directorycp "$INDEX_SOURCE" "$INDEX_PUBLIC"rm -f "$INDEX_SOURCE.bak"
echo "✅ Updated builds.false.work index"echo " Source: $INDEX_SOURCE"echo " Public: $INDEX_PUBLIC"echo ""echo "📝 Commit changes:"echo " cd /workspaces/aesthetic-computer"echo " git add false.work/builds.false.work/ system/public/builds.false.work/"echo " git commit -m \"Add SpiderLily $PLATFORM $VERSION build\""echo " git push"