Last active
March 11, 2025 08:25
-
-
Save systemswizard/6ae4446e779cf57b4fe737e856a3b1ef to your computer and use it in GitHub Desktop.
searches a mac for .DS_Store directories and fails if any are found and returns a multi-line output if there are more than one found
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# macos-util-find-DS_Store.sh inspired by https://github.com/krypted/DS_Store_Folders | |
# searches a mac for .DS_Store directories and fails if any are found and returns a multi-line output if there are more than one found | |
# https://gist.github.com/systemswizard | |
if [[ $(mdfind kind:folders AND kMDItemDisplayName:.DS_Store) ]]; then | |
echo ".DS_Store folder(s) found" | |
exit 1 | |
else | |
echo "Could not find any .DS_Store folders" | |
exit 0 | |
fi | |
exit 99 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment