87
87
SIMDEVICE="iPhone\s\d{2}\s"
88
88
REGEX="m/\{\splatform:(.*\sSimulator),.*OS:(\d{1,2}\.\d),.*name:([a-zA-Z0-9\(\)\s]*)\s\}/g"
89
89
SIMPATFORMLIST=$(cat destinations.txt | perl -nle 'if ('$REGEX') { ($plat, $os, $name) = ($1, $2, $3); if ($plat =~ /'$SIMPLATFORM'/ and $name =~ /'$SIMDEVICE'/) { print "- ${name} (${plat}) (${os})"; } }')
90
+ if [[ -z $SIMPATFORMLIST ]]; then echo "Error: no matching simulators available."; exit 1; fi
90
91
echo "Available $SIMPLATFORM simulators:"
91
92
echo "$SIMPATFORMLIST"
92
93
DESTNAME=$(cat destinations.txt | perl -nle 'if ('$REGEX') { ($plat, $os, $name) = ($1, $2, $3); if ($plat =~ /'$SIMPLATFORM'/ and $name =~ /'$SIMDEVICE'/) { print $name; } }' | sort -rV | head -n 1)
94
+ if [[ -z $DESTNAME ]]; then echo "Error: no matching simulators available."; exit 1; fi
93
95
echo "Using device name \"$DESTNAME\""
94
96
echo "DESTNAME=$DESTNAME" >> "$GITHUB_ENV"
95
97
- name : Unit Tests
@@ -113,9 +115,11 @@ jobs:
113
115
SIMDEVICE="Apple\sTV"
114
116
REGEX="m/\{\splatform:(.*\sSimulator),.*OS:(\d{1,2}\.\d),.*name:([a-zA-Z0-9\(\)\s]*)\s\}/g"
115
117
SIMPATFORMLIST=$(cat destinations.txt | perl -nle 'if ('$REGEX') { ($plat, $os, $name) = ($1, $2, $3); if ($plat =~ /'$SIMPLATFORM'/ and $name =~ /'$SIMDEVICE'/) { print "- ${name} (${plat}) (${os})"; } }')
118
+ if [[ -z $SIMPATFORMLIST ]]; then echo "Error: no matching simulators available."; exit 1; fi
116
119
echo "Available $SIMPLATFORM simulators:"
117
120
echo "$SIMPATFORMLIST"
118
121
DESTNAME=$(cat destinations.txt | perl -nle 'if ('$REGEX') { ($plat, $os, $name) = ($1, $2, $3); if ($plat =~ /'$SIMPLATFORM'/ and $name =~ /'$SIMDEVICE'/) { print $name; } }' | sort -rV | head -n 1)
122
+ if [[ -z $DESTNAME ]]; then echo "Error: no matching simulators available."; exit 1; fi
119
123
echo "Using device name \"$DESTNAME\""
120
124
echo "DESTNAME=$DESTNAME" >> "$GITHUB_ENV"
121
125
- name : Unit Tests
@@ -139,9 +143,11 @@ jobs:
139
143
SIMDEVICE="Apple\sWatch\sSeries"
140
144
REGEX="m/\{\splatform:(.*\sSimulator),.*OS:(\d{1,2}\.\d),.*name:([a-zA-Z0-9\(\)\s]*)\s\}/g"
141
145
SIMPATFORMLIST=$(cat destinations.txt | perl -nle 'if ('$REGEX') { ($plat, $os, $name) = ($1, $2, $3); if ($plat =~ /'$SIMPLATFORM'/ and $name =~ /'$SIMDEVICE'/) { print "- ${name} (${plat}) (${os})"; } }')
146
+ if [[ -z $SIMPATFORMLIST ]]; then echo "Error: no matching simulators available."; exit 1; fi
142
147
echo "Available $SIMPLATFORM simulators:"
143
148
echo "$SIMPATFORMLIST"
144
149
DESTNAME=$(cat destinations.txt | perl -nle 'if ('$REGEX') { ($plat, $os, $name) = ($1, $2, $3); if ($plat =~ /'$SIMPLATFORM'/ and $name =~ /'$SIMDEVICE'/) { print $name; } }' | sort -rV | head -n 1)
150
+ if [[ -z $DESTNAME ]]; then echo "Error: no matching simulators available."; exit 1; fi
145
151
echo "Using device name \"$DESTNAME\""
146
152
echo "DESTNAME=$DESTNAME" >> "$GITHUB_ENV"
147
153
- name : Unit Tests
0 commit comments