Skip to content

Commit f54c8fe

Browse files
johnstcnstirby
authored andcommitted
ci: conditionally disable spotlight indexing (#19124)
Work around for following issue: ``` Run sudo mdutil -a -i off sudo mdutil -a -i off sudo mdutil -X / sudo launchctl bootout system /System/Library/LaunchDaemons/com.apple.metadata.mds.plist shell: /bin/bash -e {0} 4 files/directories removed Boot-out failed: 5: Input/output error ``` This can happen if spotlight has already been disabled. (cherry picked from commit 6a35400)
1 parent b8be8cd commit f54c8fe

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,11 @@ jobs:
340340
- name: Disable Spotlight Indexing
341341
if: runner.os == 'macOS'
342342
run: |
343+
enabled=$(sudo mdutil -a -s | grep "Indexing enabled" | wc -l)
344+
if [ $enabled -eq 0 ]; then
345+
echo "Spotlight indexing is already disabled"
346+
exit 0
347+
fi
343348
sudo mdutil -a -i off
344349
sudo mdutil -X /
345350
sudo launchctl bootout system /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

0 commit comments

Comments
 (0)