| | #!/bin/bash |
| |
|
| | |
| | |
| |
|
| | |
| | fix_angular_files() { |
| | |
| | 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" <<EOF |
| | import { Component } from '@angular/core'; |
| | |
| | @Component({ |
| | selector: 'app-root', |
| | templateUrl: './app.component.html', |
| | styleUrls: ['./app.component.css'] |
| | }) |
| | export class AppComponent { |
| | title = 'agentic-dashboard'; |
| | } |
| | EOF |
| | fi |
| | fi |
| |
|
| | |
| | local component_html="src/app/app.component.html" |
| | if [ -f "$component_html" ]; then |
| | if ! grep -q 'router-outlet' "$component_html"; then |
| | echo "π Fixing app.component.html" |
| | echo "<router-outlet></router-outlet>" > "$component_html" |
| | fi |
| | fi |
| | } |
| |
|
| | |
| | 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: {}"' |
| | } |
| |
|
| | |
| | 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" |
| |
|