Repository navigation
Expand file tree
/
Copy pathtoggle_test_data.sh
More file actions
executable file
·63 lines (54 loc) · 1.86 KB
/
Copy pathtoggle_test_data.sh
File metadata and controls
executable file
·63 lines (54 loc) · 1.86 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
58
59
60
61
62
63
#!/bin/bash
# Boxing Scorecard - Test Data Toggle Script
# This script helps you quickly enable/disable test fights for screenshots
CONFIG_FILE="BoxingScorecard/AppConfig.plist"
if [ ! -f "$CONFIG_FILE" ]; then
echo "❌ Configuration file not found: $CONFIG_FILE"
exit 1
fi
# Function to get current setting
get_current_setting() {
if grep -q "<true/>" "$CONFIG_FILE" && grep -A1 "LoadTestFights" "$CONFIG_FILE" | grep -q "<true/>"; then
echo "enabled"
else
echo "disabled"
fi
}
# Function to enable test data
enable_test_data() {
sed -i '' 's/<key>LoadTestFights<\/key>/<key>LoadTestFights<\/key>/' "$CONFIG_FILE"
sed -i '' '/<key>LoadTestFights<\/key>/,+1s/<false\/>/<true\/>/' "$CONFIG_FILE"
echo "✅ Test fights ENABLED - Ready for screenshots!"
}
# Function to disable test data
disable_test_data() {
sed -i '' 's/<key>LoadTestFights<\/key>/<key>LoadTestFights<\/key>/' "$CONFIG_FILE"
sed -i '' '/<key>LoadTestFights<\/key>/,+1s/<true\/>/<false\/>/' "$CONFIG_FILE"
echo "✅ Test fights DISABLED - Clean development environment"
}
# Main script logic
current_setting=$(get_current_setting)
echo "🔧 Boxing Scorecard - Test Data Configuration"
echo "Current setting: Test fights are $current_setting"
echo ""
if [ "$1" = "enable" ] || [ "$1" = "on" ]; then
enable_test_data
elif [ "$1" = "disable" ] || [ "$1" = "off" ]; then
disable_test_data
elif [ "$1" = "toggle" ]; then
if [ "$current_setting" = "enabled" ]; then
disable_test_data
else
enable_test_data
fi
else
echo "Usage: $0 [enable|disable|toggle]"
echo ""
echo "Commands:"
echo " enable/on - Enable test fights for screenshots"
echo " disable/off - Disable test fights for development"
echo " toggle - Toggle current setting"
echo ""
echo "Current configuration:"
cat "$CONFIG_FILE"
fi