Skip to content

Instantly share code, notes, and snippets.

Created August 21, 2023 19:55
  • Star 13 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save MarcoEidinger/22feb1588c3d7be41c42853a77e52772 to your computer and use it in GitHub Desktop.
A shell script to find if any "required reason API" are used in Swift or Objective-C files within that folder or subfolders
# File timestamp APIs
# System boot time APIs
# Disk space APIs
# Active keyboard APIs
# User defaults APIs
if [ -z "$search_dir" ]; then
echo "Usage: $0 <search_dir>"
exit 1
for pattern in "${searchTerms[@]}"; do
find "$search_dir" -type f \( -name "*.swift" -o -name "*.m" \) -exec grep -H -Fw "$pattern" {} +
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment