#!/bin/bash # Regenerate DSS Core Structure Hashes # Called after successful Figma sync to update hash manifest # # Usage: scripts/regenerate-core-hashes.sh # This script should ONLY be called by the Figma sync pipeline set -e HASH_FILE=".dss/core-hashes.sha256" echo "Regenerating DSS core hashes..." { echo "# DSS Core Structure Hashes" echo "# Generated: $(date -Iseconds)" echo "# Source: Figma sync pipeline" echo "# DO NOT EDIT MANUALLY" echo "" echo "# Format: SHA256 filepath" # Hash schema files for f in .dss/schema/*.json; do [ -f "$f" ] && sha256sum "$f" done # Hash skin files for f in dss-claude-plugin/core/skins/*.json; do [ -f "$f" ] && sha256sum "$f" done # Hash core tokens [ -f "dss/core_tokens/tokens.json" ] && sha256sum "dss/core_tokens/tokens.json" # Hash _system output if exists if [ -d ".dss/data/_system" ]; then find .dss/data/_system -type f -name "*.json" -o -name "*.css" -o -name "*.scss" 2>/dev/null | while read f; do sha256sum "$f" done fi } > "$HASH_FILE" echo "Hash manifest updated: $HASH_FILE" echo "Files hashed: $(grep -c "^[a-f0-9]" "$HASH_FILE")"