-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patherrors.sh
More file actions
executable file
·55 lines (45 loc) · 1.62 KB
/
Copy patherrors.sh
File metadata and controls
executable file
·55 lines (45 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env bash
# Simple Flutter/Dart checker: format -> fix -> analyze
# Shows all output in terminal, stops on first failure
set -e # Exit on any command failure
# Add Dart and Flutter to PATH for all environments (fixes Android Studio UI push)
export PATH="$PATH:/home/develop4god/development/flutter/bin"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PROJECT_ROOT="$SCRIPT_DIR"
# Debug: Print environment and path info for hook troubleshooting
(
echo "[DEBUG] Current PATH: $PATH"
echo "[DEBUG] which dart: $(which dart || echo 'dart not found')"
echo "[DEBUG] which flutter: $(which flutter || echo 'flutter not found')"
echo "[DEBUG] whoami: $(whoami)"
echo "[DEBUG] SHELL: $SHELL"
echo "[DEBUG] env (filtered):"
env | grep -E 'PATH|DART|FLUTTER' || true
) >&2
echo "================================================"
echo "Flutter Check - $(date '+%Y-%m-%d %H:%M:%S')"
echo "Project: $PROJECT_ROOT"
echo "================================================"
cd "$PROJECT_ROOT"
# Step 1: Format
echo ""
echo "▶ Running: dart format ."
echo "------------------------------------------------"
dart format .
echo "✓ Format complete"
# Step 2: Fix
echo ""
echo "▶ Running: dart fix --apply"
echo "------------------------------------------------"
dart fix --apply
echo "✓ Fix complete"
# Step 3: Analyze
echo ""
echo "▶ Running: flutter analyze --fatal-infos ."
echo "------------------------------------------------"
flutter analyze --fatal-infos .
echo "✓ Analyze complete"
echo ""
echo "================================================"
echo "✓ All checks passed!"
echo "================================================"