Showing 1 changed files with 34 additions and 0 deletions
+34 -0
pre-commit-check.sh
@@ -0,0 +1,34 @@
1
+#!/bin/bash
2
+# Pre-commit build verification script
3
+# Usage: ./pre-commit-check.sh
4
+
5
+set -e
6
+
7
+PROJECT_PATH="/Users/bogdan/Documents/Workspaces/Xcode/USB Meter"
8
+cd "$PROJECT_PATH"
9
+
10
+echo "๐Ÿ“‹ Pre-commit checks..."
11
+echo ""
12
+
13
+# Check 1: Git status
14
+echo "1๏ธโƒฃ  Git status:"
15
+git status --short
16
+echo ""
17
+
18
+# Check 2: Build test for Mac Catalyst
19
+echo "2๏ธโƒฃ  Building for Mac Catalyst..."
20
+if xcodebuild build -scheme "USB Meter" \
21
+  -destination "platform=macOS,arch=arm64,variant=Mac Catalyst" \
22
+  -quiet 2>&1 | tail -1 | grep -q "BUILD SUCCEEDED"; then
23
+  echo "โœ… Build succeeded"
24
+else
25
+  echo "โŒ Build failed โ€” see details above"
26
+  exit 1
27
+fi
28
+echo ""
29
+
30
+# Check 3: Syntax check (optional, but useful)
31
+echo "3๏ธโƒฃ  Summary:"
32
+echo "โœ… All checks passed โ€” safe to commit"
33
+echo ""
34
+echo "๐Ÿ“ Next: git commit -m \"...\""