mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2026-01-06 18:17:26 +08:00
Run osascript with retry (#5090)
This commit is contained in:
committed by
GitHub
parent
cc2a6e1158
commit
cb5ab38b09
@@ -1,6 +1,16 @@
|
|||||||
#!/bin/bash -e -o pipefail
|
#!/bin/bash -e -o pipefail
|
||||||
|
|
||||||
openwindows=$(osascript -e 'tell application "System Events" to get every window of (every process whose class of windows contains window)')
|
retry=10
|
||||||
|
while [ $retry -gt 0 ]; do
|
||||||
|
openwindows=$(osascript -e 'tell application "System Events" to get every window of (every process whose class of windows contains window)') && break
|
||||||
|
|
||||||
|
retry=$((retry-1))
|
||||||
|
if [ $retry -eq 0 ]; then
|
||||||
|
echo "No retry attempts left"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
sleep 30
|
||||||
|
done
|
||||||
IFS=',' read -r -a windowslist <<< "$openwindows"
|
IFS=',' read -r -a windowslist <<< "$openwindows"
|
||||||
|
|
||||||
if [ -n "${openwindows}" ]; then
|
if [ -n "${openwindows}" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user