← back to Designer Wallcoverings

DW-Agents/dw-agents/fix-theme-imports.sh

41 lines

#!/bin/bash
# Add theme imports to all agents

AGENTS=(
    "marketing-agent.ts"
    "purchasing-office-agent.ts"
    "accounting-agent.ts"
    "digital-samples-agent.ts"
    "trend-research-agent.ts"
    "task-orchestrator-agent.ts"
    "completed-tasks-agent.ts"
    "needs-attention-agent.ts"
    "new-client-signup-agent.ts"
    "todays-highlights-agent.ts"
    "server-uptime-agent.ts"
    "in-parallel-agent.ts"
    "parallel-processes-agent.ts"
)

cd /root/DW-Agents

for agent in "${AGENTS[@]}"; do
    if [ -f "$agent" ]; then
        # Check if already has the import
        if grep -q "getThemeStyles.*require.*shared-ui-components" "$agent"; then
            echo "✅ $agent already has import"
        else
            # Find the line with "const app = express();"
            # Insert the import before it
            sed -i '/const app = express();/i\
// Import theme utilities\
const { getThemeStyles } = require('"'"'./shared-ui-components.js'"'"');\
' "$agent"
            echo "✅ Added import to $agent"
        fi
    fi
done

echo ""
echo "✅ All imports added!"