forked from Final-touches-bdg/Code-test
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfix-project.sh
More file actions
27 lines (19 loc) · 849 Bytes
/
fix-project.sh
File metadata and controls
27 lines (19 loc) · 849 Bytes
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
#!/bin/bash
# Script to fix the project file to avoid "Multiple commands produce" errors
# Ensure we're in the repo root
cd "$(git rev-parse --show-toplevel)" || exit 1
# Define the fixed text to add to the exception list
FIXED_TEXT='SettingsHeaderTableViewCell.swift,\
AILearningSettingsViewController.swift,\
ImprovedLearningSettingsCell.swift,\
ImprovedLearningViewController.swift,\
ModelServerIntegrationViewController.swift,'
# Find the line to modify (after "Info.plist,")
LINE_NUM=$(grep -n "Info.plist," backdoor.xcodeproj/project.pbxproj | head -1 | cut -d: -f1)
if [ -z "$LINE_NUM" ]; then
echo "Error: Could not find 'Info.plist,' line in project file"
exit 1
fi
# Insert the fixed text after the Info.plist line
sed -i "${LINE_NUM}a\\${FIXED_TEXT}" backdoor.xcodeproj/project.pbxproj
echo "Project file successfully patched"