8787 SIMDEVICE="iPhone\s\d{2}\s"
8888 REGEX="m/\{\splatform:(.*\sSimulator),.*OS:(\d{1,2}\.\d),.*name:([a-zA-Z0-9\(\)\s]*)\s\}/g"
8989 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
9091 echo "Available $SIMPLATFORM simulators:"
9192 echo "$SIMPATFORMLIST"
9293 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
9395 echo "Using device name \"$DESTNAME\""
9496 echo "DESTNAME=$DESTNAME" >> "$GITHUB_ENV"
9597 - name : Unit Tests
@@ -113,9 +115,11 @@ jobs:
113115 SIMDEVICE="Apple\sTV"
114116 REGEX="m/\{\splatform:(.*\sSimulator),.*OS:(\d{1,2}\.\d),.*name:([a-zA-Z0-9\(\)\s]*)\s\}/g"
115117 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
116119 echo "Available $SIMPLATFORM simulators:"
117120 echo "$SIMPATFORMLIST"
118121 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
119123 echo "Using device name \"$DESTNAME\""
120124 echo "DESTNAME=$DESTNAME" >> "$GITHUB_ENV"
121125 - name : Unit Tests
@@ -139,9 +143,11 @@ jobs:
139143 SIMDEVICE="Apple\sWatch\sSeries"
140144 REGEX="m/\{\splatform:(.*\sSimulator),.*OS:(\d{1,2}\.\d),.*name:([a-zA-Z0-9\(\)\s]*)\s\}/g"
141145 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
142147 echo "Available $SIMPLATFORM simulators:"
143148 echo "$SIMPATFORMLIST"
144149 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
145151 echo "Using device name \"$DESTNAME\""
146152 echo "DESTNAME=$DESTNAME" >> "$GITHUB_ENV"
147153 - name : Unit Tests
0 commit comments