-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
Β·57 lines (46 loc) Β· 1.48 KB
/
build.sh
File metadata and controls
executable file
Β·57 lines (46 loc) Β· 1.48 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
56
57
#!/bin/bash
echo "π¨ Building Chat app..."
echo ""
# Build the project, suppressing verbose output
xcodebuild -project Chat.xcodeproj -scheme Chat -configuration Release clean build 2>&1 | \
while IFS= read -r line; do
if [[ "$line" == *"BUILD SUCCEEDED"* ]]; then
echo "β
Build completed successfully"
break
elif [[ "$line" == *"BUILD FAILED"* ]]; then
echo "β Build failed"
echo "$line"
exit 1
elif [[ "$line" == *"Compiling"* ]] || [[ "$line" == *"Linking"* ]] || [[ "$line" == *"Processing"* ]]; then
echo "βοΈ $line"
elif [[ "$line" == *"error:"* ]] || [[ "$line" == *"warning:"* ]]; then
echo "$line"
fi
done
if [ ${PIPESTATUS[0]} -ne 0 ]; then
echo "β Build failed"
exit 1
fi
echo ""
# Find the built app in DerivedData
APP_PATH="$(find ~/Library/Developer/Xcode/DerivedData -name "Chat.app" -path "*/Release/*" | head -1)"
if [ ! -d "$APP_PATH" ]; then
echo "β App not found in DerivedData"
echo "Looking in: $APP_PATH"
exit 1
fi
echo "π Found app at: $APP_PATH"
echo "π¦ Installing to /Applications..."
# Remove existing app if it exists
if [ -d "/Applications/Chat.app" ]; then
echo "ποΈ Removing existing Chat.app from Applications"
rm -rf "/Applications/Chat.app"
fi
# Copy the new app
cp -R "$APP_PATH" "/Applications/"
if [ $? -eq 0 ]; then
echo "π Chat.app successfully installed to /Applications"
else
echo "β Failed to install Chat.app"
exit 1
fi