#!/bin/bash # Angular Project Structure Fixer # Version 1.3 - Production Ready # Fix component files fix_angular_files() { # Fix app.component.ts local component_ts="src/app/app.component.ts" if [ -f "$component_ts" ]; then if ! grep -q 'templateUrl' "$component_ts"; then echo "🔄 Fixing app.component.ts" cat > "$component_ts" <" > "$component_html" fi fi } # Safe file search function check_project_structure() { echo "🔍 Checking project structure..." find src \ -name "*.ts" -o \ -name "*.html" -o \ -name "*.css" \ -not -path "src/app/*" \ -not -path "*/environments/*" \ -not -path "*/node_modules/*" \ -not -path "*/dist/*" \ -print0 | xargs -0 -I {} sh -c 'echo "⚠️ Found file in non-standard location: {}"' } # Main execution echo "🚀 Starting Angular project fix..." fix_angular_files check_project_structure echo "✅ All fixes applied" echo "Running production build..." ng build --configuration=production --project=agentic-dashboard echo "Next steps:" echo "1. Check build output above" echo "2. Deploy files from dist/ directory" echo "3. Configure server routing for Angular"