#!/bin/bash

set -e

SIDESTORE="/Users/andreashenggie/Sidestore"

OUTPUT="$SIDESTORE/source.json"
META_DIR="$SIDESTORE/apps-metadata"


echo "Building SideStore source..."


APPS=$(jq -s '.' "$META_DIR"/*.json)


cat > "$OUTPUT" <<EOF
{
  "name": "Andreas's Source",
  "subtitle": "",
  "description": "",
  "iconURL": "https://i.imgur.com/pqIZoZo.jpeg",
  "website": "https://altstudio.app",
  "patreonURL": "https://patreon.com/altstudio",
  "tintColor": "#6156e2",
  "featuredApps": [],
  "apps": $APPS,
  "news": []
}
EOF


echo "Generated:"
cat "$OUTPUT"
