Skip to content

Commit 0013607

Browse files
fix(ci): Add error handling and fix version matching in iOS setup
- Add `set -e` to fail fast on critical command failures - Use `grep -Fq` for fixed-string matching to avoid regex issues with version dots Co-authored-by: MartinZikmund <1075116+MartinZikmund@users.noreply.github.com>
1 parent 4dfb318 commit 0013607

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

build/ci/templates/ios-build-select-version.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ parameters:
33

44
steps:
55
- bash: |
6+
set -e
67
echo 'xCode Root to ${{parameters.xCodeRoot}}'
78
echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'${{parameters.xCodeRoot}}
89
sudo xcode-select --switch ${{parameters.xCodeRoot}}/Contents/Developer
@@ -22,7 +23,7 @@ steps:
2223
exit 0
2324
fi
2425
elif [ -n "$SDK_VERSION" ]; then
25-
if xcrun simctl list runtimes | grep -q "iOS $SDK_VERSION"; then
26+
if xcrun simctl list runtimes | grep -Fq "iOS $SDK_VERSION"; then
2627
echo "Required iOS simulator runtime already installed."
2728
exit 0
2829
fi
@@ -51,7 +52,7 @@ steps:
5152
fi
5253
if [ -n "$SDK_BUILD_VERSION" ] && xcrun simctl list runtimes | grep -q "iOS.*$SDK_BUILD_VERSION"; then
5354
echo "Required iOS simulator runtime now installed."
54-
elif [ -n "$SDK_VERSION" ] && xcrun simctl list runtimes | grep -q "iOS $SDK_VERSION"; then
55+
elif [ -n "$SDK_VERSION" ] && xcrun simctl list runtimes | grep -Fq "iOS $SDK_VERSION"; then
5556
echo "Required iOS simulator runtime now installed."
5657
elif [ -z "$SDK_BUILD_VERSION" ] && [ -z "$SDK_VERSION" ] && xcrun simctl list runtimes | grep -q "iOS"; then
5758
echo "iOS simulator runtime now installed."

0 commit comments

Comments
 (0)