Skip to content

Instantly share code, notes, and snippets.

@joshbuhler
Created March 20, 2019 20:22
Show Gist options
  • Save joshbuhler/380031e75fa1837c2019a0837754fbe2 to your computer and use it in GitHub Desktop.
Save joshbuhler/380031e75fa1837c2019a0837754fbe2 to your computer and use it in GitHub Desktop.
Used to run plutil -lint against all .strings files found in a folder, or its subfolders.
# Usage: sh stringsValidator.sh ~/path/to/strings/folder
rootFolder=.
if [[ $1 ]]; then
rootFolder=$1
fi
stringsFiles=$(find $rootFolder -type f -name "*.strings");
for stringsFile in $stringsFiles; do
plResult=$(plutil -lint $stringsFile)
if [[ $plResult == *".strings: OK"* ]]; then
echo "✅" $plResult
else
echo "🛑" $plResult
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment