Last active
May 14, 2021 03:33
-
-
Save jimmyhoran/99ebb576d1cdc88234101257b4473e47 to your computer and use it in GitHub Desktop.
Script to complete a basic check of the fastlane devices.txt file format, where it must use tabs.
This file contains hidden or 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
#!/usr/bin/env bash | |
# | |
# lint-devices-file | |
# Usage example: ./scripts/ios/lint-devices-file fastlane/devices.txt | |
FILE=$1 | |
TAB_COUNT=$(grep "$(printf '\t')" $FILE | wc -l) | |
NEW_LINE_COUNT=$(grep "$(printf '\n')" $FILE | wc -l) | |
if [ $TAB_COUNT -eq $NEW_LINE_COUNT ]; then | |
echo "✅ $FILE format is correct 🎉" | |
exit 0 | |
else | |
echo "⛔️ $FILE is missing a TAB between device id and device name" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment