File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 69
69
# Set scheme
70
70
if [[ -z " ${SCHEME:- } " ]]; then
71
71
if [[ " $SPM " == true ]]; then
72
- SCHEME=" ${SAMPLE} Example (${OS} )"
72
+ # Get the list of schemes
73
+ schemes=$( xcodebuild -list -project " ${DIR} /${SAMPLE} Example.xcodeproj" |
74
+ grep -E ' ^\s+' |
75
+ sed -e ' s/^[[:space:]]*//' -e ' s/[[:space:]]*$//' )
76
+
77
+ # Check for the base scheme name
78
+ if echo " $schemes " | grep -q " ^${SAMPLE} Example$" ; then
79
+ SCHEME=" ${SAMPLE} Example"
80
+ # Check for the OS-suffixed scheme name
81
+ elif echo " $schemes " | grep -q " ^${SAMPLE} Example (${OS} )$" ; then
82
+ SCHEME=" ${SAMPLE} Example (${OS} )"
83
+ else
84
+ echo " Error: Could not find a suitable scheme for ${SAMPLE} Example in ${OS} ."
85
+ echo " Available schemes:"
86
+ echo " $schemes "
87
+ exit 1
88
+ fi
73
89
else
74
90
SCHEME=" ${SAMPLE} Example${SWIFT_SUFFIX:- } "
75
91
fi
You can’t perform that action at this time.
0 commit comments