-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·55 lines (44 loc) · 1.73 KB
/
deploy.sh
File metadata and controls
executable file
·55 lines (44 loc) · 1.73 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
#!/bin/bash
set -e
echo "=== Digital Rain Screensaver Deploy Script ==="
# Kill any running screensaver processes and System Settings
echo "Killing screensaver processes and System Settings..."
pkill -f legacyScreenSaver 2>/dev/null || true
pkill -f "Screen Saver" 2>/dev/null || true
pkill -f "System Settings" 2>/dev/null || true
# Wait a moment for processes to terminate
sleep 1
# Build the project
echo "Building..."
cd "$(dirname "$0")"
xcodebuild -project digitalrain.xcodeproj -scheme digitalrain -configuration Debug build 2>&1 | grep -E "(error:|warning:|BUILD)" | grep -v "Metadata extraction skipped"
# Check if build succeeded
if [ ${PIPESTATUS[0]} -ne 0 ]; then
echo "ERROR: Build failed!"
exit 1
fi
# Find the built product (exclude Index.noindex which contains incomplete builds)
DERIVED_DATA="$HOME/Library/Developer/Xcode/DerivedData"
SAVER_PATH=$(find "$DERIVED_DATA" -name "Digital Rain.saver" -path "*/Build/Products/Debug/*" -not -path "*/Index.noindex/*" -type d 2>/dev/null | head -1)
if [ -z "$SAVER_PATH" ]; then
echo "ERROR: Could not find built Digital Rain.saver"
exit 1
fi
echo "Found built screensaver at: $SAVER_PATH"
# Remove old installation
echo "Removing old installation..."
rm -rf "$HOME/Library/Screen Savers/Digital Rain.saver"
# Install new version (preserve timestamps for code signing)
echo "Installing..."
cp -Rp "$SAVER_PATH" "$HOME/Library/Screen Savers/"
# Verify installation
if [ -d "$HOME/Library/Screen Savers/Digital Rain.saver" ]; then
echo "=== Deployment successful! ==="
echo ""
echo "Opening System Settings → Screen Saver..."
sleep 1
open "x-apple.systempreferences:com.apple.ScreenSaver-Settings.extension"
else
echo "ERROR: Installation failed!"
exit 1
fi