#!/bin/bash # Heretekize — Replace upstream references with Heretek-AI # Usage: ./scripts/heretekize.sh set -e SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" WORKSPACE_ROOT="$(dirname "$SCRIPT_DIR")" echo "🦞 === Heretekizing Codebase ===" echo "" cd "$WORKSPACE_ROOT" # Replace GitHub repo references echo "Replacing Heretek-AI/openclaw → Heretek-AI/openclaw..." find . -type f \( -name "*.md" -o -name "*.json" -o -name "*.ts" -o -name "*.js" -o -name "*.sh" \) \ ! -path "./node_modules/*" \ ! -path "./.git/*" \ ! -path "./heretek-ai-openclaw-*.tgz" \ -exec sed -i.bak 's|Heretek-AI/openclaw|Heretek-AI/openclaw|g' {} \; # Replace NPM package references echo "Replacing @heretek-ai/openclaw → @heretek-ai/openclaw..." find . -type f \( -name "*.md" -o -name "*.json" -o -name "*.ts" -o -name "*.js" -o -name "*.sh" \) \ ! -path "./node_modules/*" \ ! -path "./.git/*" \ ! -path "./heretek-ai-openclaw-*.tgz" \ -exec sed -i.bak 's|@heretek-ai/openclaw|@heretek-ai/openclaw|g' {} \; # Replace upstream remote references echo "Replacing upstream → heretek..." find . -type f \( -name "*.md" -o -name "*.json" -o -name "*.ts" -o -name "*.js" -o -name "*.sh" \) \ ! -path "./node_modules/*" \ ! -path "./.git/*" \ ! -path "./heretek-ai-openclaw-*.tgz" \ -exec sed -i.bak 's|heretek/main|heretek/main|g' {} \; # Clean up .bak files find . -type f -name "*.bak" \ ! -path "./node_modules/*" \ ! -path "./.git/*" \ -delete echo "✅ Heretekized" echo "" echo "Verifying changes:" grep -r "Heretek-AI/openclaw" --include="*.md" --include="*.json" . 2>/dev/null | head -5 || echo "No changes found" echo "" echo "Commit and push:" echo " git add -A && git commit -m 'feat: heretekize codebase'" echo " git push origin main"