Skip to content

Commit 4a61379

Browse files
fix: review changes
1 parent a3e2a7f commit 4a61379

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

.maestro/scripts/run-tests.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ while [ $# -gt 0 ]; do
5959
esac
6060
done
6161

62+
if ! [[ "$SHARDS" =~ ^[0-9]+$ ]]; then
63+
echo "Error: --shards requires a numeric integer. Received: '$SHARDS'" >&2
64+
exit 1
65+
fi
66+
6267
[ -z "$FLOWS" ] && FLOWS=".maestro/enrichedInput/flows .maestro/enrichedText/flows"
6368

6469
case "$PLATFORM" in
@@ -91,6 +96,10 @@ TTY_OUT=/dev/tty
9196
( : > /dev/tty ) 2>/dev/null || TTY_OUT=/dev/stderr
9297

9398
DEVICE_IDS_CSV=$("$SETUP" "$SHARDS" | tee "$TTY_OUT" | grep "^DEVICE_IDS=" | cut -d= -f2)
99+
if [ -z "$DEVICE_IDS_CSV" ]; then
100+
echo "Error: setup script did not return any DEVICE_IDS" >&2
101+
exit 1
102+
fi
94103
IFS=',' read -r -a DEVICES <<< "$DEVICE_IDS_CSV"
95104
DEVICE_ID="${DEVICES[0]}"
96105

.maestro/scripts/setup-android-emulator.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
set -euo pipefail
1212

1313
NUM_DEVICES="${1:-1}"
14+
if ! [[ "$NUM_DEVICES" =~ ^[0-9]+$ ]] || [ "$NUM_DEVICES" -lt 1 ]; then
15+
echo "Error: num_devices must be a positive integer (got '$NUM_DEVICES')" >&2
16+
exit 1
17+
fi
1418

1519
API_LEVEL="36"
1620
DEVICE_ID="pixel_9"

.maestro/scripts/setup-ios-simulator.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
set -euo pipefail
1212

1313
NUM_DEVICES="${1:-1}"
14+
if ! [[ "$NUM_DEVICES" =~ ^[0-9]+$ ]] || [ "$NUM_DEVICES" -lt 1 ]; then
15+
echo "Error: num_devices must be a positive integer (got '$NUM_DEVICES')" >&2
16+
exit 1
17+
fi
1418

1519
DEVICE_TYPE="com.apple.CoreSimulator.SimDeviceType.iPhone-17"
1620
IOS_VERSION="26.2"

0 commit comments

Comments
 (0)