Skip to content

Instantly share code, notes, and snippets.

@jimmyhoran
Last active May 14, 2021 03:33
Show Gist options
  • Save jimmyhoran/99ebb576d1cdc88234101257b4473e47 to your computer and use it in GitHub Desktop.
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.
#!/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