mirror of
https://github.com/actions/runner-images.git
synced 2025-12-15 06:08:07 +00:00
[macOS] Rename build scripts (#8887)
Co-authored-by: Alexey Ayupov <“alexey.ayupov@akvelon.com”>
This commit is contained in:
43
images/macos/scripts/build/configure-windows.sh
Normal file
43
images/macos/scripts/build/configure-windows.sh
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/bin/bash -e -o pipefail
|
||||
################################################################################
|
||||
## File: configure-windows.sh
|
||||
## Desc: Close open windows
|
||||
################################################################################
|
||||
|
||||
source ~/utils/utils.sh
|
||||
|
||||
# Close System Preferences window because in Ventura arm64 it is opened by default on Apperance tab
|
||||
if is_Arm64; then
|
||||
echo "Close System Preferences window"
|
||||
osascript -e 'tell application "System Preferences" to quit'
|
||||
fi
|
||||
|
||||
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"
|
||||
|
||||
if [ -n "${openwindows}" ]; then
|
||||
echo "Found opened window:"
|
||||
fi
|
||||
|
||||
for window in "${windowslist[@]}"; do
|
||||
if [[ $window =~ "NotificationCenter" ]]; then
|
||||
echo "[Warning] $window"
|
||||
else
|
||||
echo " - ${window}" | xargs
|
||||
scripterror=true
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "${scripterror}" = true ]; then
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user