Skip to content

Commit 1885fa4

Browse files
committed
Improved diagnostic output of matching simulators
1 parent c711036 commit 1885fa4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

scripts/id.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,21 @@ SIMPLATFORMS_REGEX="m/(.*)\t(.*)\t(.*)\t(.*)/g"
4141
if [[ -n $OSVERSION_REGEX ]]; then
4242
echo "Finding OS version using regex: ${OSVERSION_REGEX}."
4343
MATCHES=$(echo "${SIMPLATFORMS}" | perl -nle 'if ('$SIMPLATFORMS_REGEX') { ($name, $plat, $os, $id) = ($1, $2, $3, $4); if ($os =~ /'$OSVERSION_REGEX'/) { print "${name}\t${plat}\t${os}\t${id}"; } }')
44+
MATCHESDESC=$(echo "${MATCHES}" | perl -nle 'if ('$SIMPLATFORMS_REGEX') { ($name, $plat, $os, $id) = ($1, $2, $3, $4); print "${name} (${plat} - ${os}) - ${id}"; }')
4445
TOPLINEMATCH=$(echo "${MATCHES}" | head -n 1)
4546
DESTID=$(echo "${TOPLINEMATCH}" | perl -le 'if ('$SIMPLATFORMS_REGEX') { ($name, $plat, $os, $id) = ($1, $2, $3, $4); if ($os =~ /'$OSVERSION_REGEX'/) { print "${id}"; } }')
4647
DESTDESC=$(echo "${TOPLINEMATCH}" | perl -le 'if ('$SIMPLATFORMS_REGEX') { ($name, $plat, $os, $id) = ($1, $2, $3, $4); if ($os =~ /'$OSVERSION_REGEX'/) { print "${name} (${plat} - ${os}) - ${id}"; } }' | head -n 1)
4748
else
4849
echo "Finding latest OS version for target."
49-
MATCHES="$SIMPLATFORMS"
50+
MATCHESDESC=$(echo "${SIMPLATFORMS}" | perl -nle 'if ('$SIMPLATFORMS_REGEX') { ($name, $plat, $os, $id) = ($1, $2, $3, $4); print "${name} (${plat} - ${os}) - ${id}"; }')
5051
TOPLINEMATCH=$(echo "${SIMPLATFORMS}" | head -1)
5152
DESTID=$(echo "${TOPLINEMATCH}" | perl -nle 'if ('$SIMPLATFORMS_REGEX') { ($name, $plat, $os, $id) = ($1, $2, $3, $4); print $id; }')
5253
DESTDESC=$(echo "${TOPLINEMATCH}" | perl -nle 'if ('$SIMPLATFORMS_REGEX') { ($name, $plat, $os, $id) = ($1, $2, $3, $4); print "${name} (${plat} - ${os}) - ${id}"; }')
5354
fi
5455

5556
# Provide diagnostic output of all matching simulators.
5657
echo "Available simulators matching the target:"
57-
echo "$(echo "$MATCHES" | while read line; do echo "- $line"; done)"
58+
echo "$(echo "$MATCHESDESC" | while read line; do echo "- $line"; done)"
5859
5960
# Exit out if no simulators matched the criteria.
6061
if [[ -z $DESTID ]]; then echo "⛔️ Error: No matching simulators available."; exit 1; fi

0 commit comments

Comments
 (0)